emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "The starting list count" ?????


From: Alan Mackenzie
Subject: Re: "The starting list count" ?????
Date: Mon, 3 Jan 2022 21:03:33 +0000

Hello, Stefan.

On Mon, Jan 03, 2022 at 15:38:33 -0500, Stefan Monnier wrote:
> > I might have understood it now.  I think (1 . #1) refers to:

> No, if you see (1 . #1) then it's an error.

What I actually saw was in a backtrace, after C-g'ing out of the byte
compilation of set-tests.el, and was this:

Debugger entered--Lisp error: (quit)
  copy-tree((1 . #1) t)
  macroexp-strip-symbol-positions((1 . #1))
  byte-compile-constant((1 . #1))
  byte-compile-quote('(1 . #2))
  byte-compile-form('(1 . #2))

> The #1 means "the second heap object between the root and here" and in
> (1 . #1) there's only one heap object.

I can cope with "the second heap object", but what is "the root"?

> You can have

>     [a b c (1 . #1)]
> and
>     ((1 . #1))
> and
>     (a . (1 . #1))

> and many more, but not just

>     (1 . #1)

Yes.  Looking at seq-tests.el, it's clear the original source for it is

    (let ((l1 '#1=(1 . #1#))) ....)

, that being the only circular list or setc[ad]r in the entire file.

I'm actually feeling quite sad about the whole business.  There doesn't
appear to be a lot of support for circular lists in Emacs.  Does that
mean I have to write my own version of copy-tree (?etc.) that handles
circularity?  It's surely something that's already been done dozens of
times.

> -- Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]