all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: "The starting list count" ?????
Date: Mon, 3 Jan 2022 21:03:33 +0000	[thread overview]
Message-ID: <YdNkpdh0vcQfAcGA@ACM> (raw)
In-Reply-To: <jwvtuekv9ph.fsf-monnier+emacs@gnu.org>

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).



  parent reply	other threads:[~2022-01-03 21:03 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
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 [this message]
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=YdNkpdh0vcQfAcGA@ACM \
    --to=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.