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 19:21:33 +0000

Hello, Stefan.

On Mon, Jan 03, 2022 at 13:05:23 -0500, Stefan Monnier wrote:
> > ..  What does this mean, please?  What does "is the starting list count"
> > mean?  There is only one "list", so what is the "list count"?

> I'm not sure how to define it in general, but:

>     (let ((x (list 1 2 3 4 5 6 7))) (setf (nthcdr 5 x) (nthcdr N x)) x)

> returns a list with a #N inside of it (well, for N sufficiently small
> to make sense here, obviously).

> AFAIK this is only used to avoid inf-looping, but if/when you actually
> care about that you should use `print-circle` which additionally
> preserves sharing and gives an output that's more explicit about
> what's going on, and hence easier to understand (tho not necessarily
> easier to read).

I might have understood it now.  I think (1 . #1) refers to:

                       -----------------    ---
                       |               |    | |
                       |               v    v |
-----------------------+--------     ---------+-----------------------  
|               |      |       |     |        |       |              |      
|               |      |       |     |        |       |              |
|               |      |       |     |        |       |              |
|      1        |      |       |     |        |       |     nil      |
|               |              |     |                |              |
|               |              |     |                |              |
|               |              |     |                |              |
--------------------------------     ---------------------------------


Am I right?  This is an ugly thing, which surely only the most twisted of
imaginations could conceive.  ;-)

Obviously, a depth first operation on this "list" is going to take a long
time.

Just as a matter of interest, this object is being passed to
macroexp-strip-symbol-positions during the byte compilation of
seq-tests.el.

>         Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

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