all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: Robin Tarsiger <rtt@dasyatidae.com>
Cc: acm@muc.de, emacs-devel@gnu.org
Subject: Re: "The starting list count" ?????
Date: Mon, 03 Jan 2022 19:33:20 +0100	[thread overview]
Message-ID: <874k6k1xfz.fsf@igel.home> (raw)
In-Reply-To: <4b0fc44c-8ef2-e6c8-0146-1497fe43acf7@dasyatidae.com> (Robin Tarsiger's message of "Mon, 3 Jan 2022 12:00:29 -0600")

On Jan 03 2022, Robin Tarsiger wrote:

> Alan Mackenzie wrote:
>>     `#N'
>>         When printing circular structures, this construct is used to
>>         represent where the structure loops back onto itself, and `N' is
>>         the starting list count:
>>              (let ((a (list 1)))
>>                (setcdr a a))
>>              => (1 . #0)
>> ..  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 agree that this is a bit too abbreviated, but basically it's the number
> you'd pass to nthcdr along with the immediately enclosing list to get what's
> spliced in as that last cdr.

It gets more complicated if the circle is embedded inside another
object.

ELISP> (list (let ((a (list 1))) (setcdr a a)))
((1 . #1))

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."



  reply	other threads:[~2022-01-03 18:33 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-03 17:49 "The starting list count" ????? Alan Mackenzie
2022-01-03 18:00 ` Robin Tarsiger
2022-01-03 18:33   ` Andreas Schwab [this message]
2022-01-03 18:59     ` Robin Tarsiger
2022-01-03 19:24       ` Andreas Schwab
2022-01-03 19:36       ` Eli Zaretskii
2022-01-03 18:54   ` Alan Mackenzie
2022-01-03 19:26     ` Andreas Schwab
2022-01-03 18:05 ` Stefan Monnier
2022-01-03 19:21   ` Alan Mackenzie
2022-01-03 19:50     ` Andreas Schwab
2022-01-03 19:55       ` Alan Mackenzie
2022-01-03 20:38     ` Stefan Monnier
2022-01-03 20:58       ` Stefan Monnier
2022-01-03 21:03       ` Alan Mackenzie
2022-01-03 21:15         ` Stefan Monnier
2022-01-03 21:33           ` Alan Mackenzie
2022-01-04  0:43             ` Stefan Monnier
2022-01-03 18:13 ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874k6k1xfz.fsf@igel.home \
    --to=schwab@linux-m68k.org \
    --cc=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    --cc=rtt@dasyatidae.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.