all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Philip Kaludercic <philipk@posteo.net>
Cc: Ruijie Yu <ruijie@netyu.xyz>, 62037@debbugs.gnu.org
Subject: bug#62037: (proper-list-p '#1=(a #1#)) => 2.  It should return nil.
Date: Sat, 18 Mar 2023 08:29:02 +0000	[thread overview]
Message-ID: <ZBV2TlXqrirkPBNT@ACM> (raw)
In-Reply-To: <873562jylh.fsf@posteo.net>

Hello, Philip.

On Sat, Mar 18, 2023 at 07:41:14 +0000, Philip Kaludercic wrote:
> Ruijie Yu <ruijie@netyu.xyz> writes:

> > Notice the distinction between these two snippets:

> >     (let ((lst-1 '#1=(a #1#)))
> >       (list lst-1 (proper-list-p lst-1)))
> >     ;; => ((a #1) 2)

> >     (let ((lst-2 '#1=(a . #1#)))
> >       (list lst-2 (proper-list-p lst-2)))
> >     ;; => ((a . #0) nil)

> Doesn't this point resolve the issue?

No, it doesn't.  A circular list is defined (Elisp manual page "Lists
and Cons Cells") as one where "some cons cell’s CDR could point to one
of the previous cons cells in the list".  A proper list (page
"List-related Predicates") is one which is neither dotted nor circular.

The list #1=(a . #1#) is clearly circular.  proper-list-p should return
nil for it.

The purpose of proper-list-p is surely to find out in advance whether an
algorithm one wishes to run on a list can proceed without taking special
precautions for dottedness or circularity.  proper-list-p fails here.

> Shouldn't the bug report be closed?

Only once it's been fixed.

> -- 
> Philip Kaludercic

-- 
Alan Mackenzie (Nuremberg, Germany).





  reply	other threads:[~2023-03-18  8:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-07 17:29 bug#62037: (proper-list-p '#1=(a #1#)) => 2. It should return nil Alan Mackenzie
2023-03-08  4:13 ` Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-18  7:41   ` Philip Kaludercic
2023-03-18  8:29     ` Alan Mackenzie [this message]
2023-03-18 13:48       ` Philip Kaludercic
2023-03-31  4:35         ` Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-31  7:25           ` Philip Kaludercic
2023-03-31  7:29             ` Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-31  7:50               ` Eli Zaretskii
2023-04-01 14:16                 ` Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors

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=ZBV2TlXqrirkPBNT@ACM \
    --to=acm@muc.de \
    --cc=62037@debbugs.gnu.org \
    --cc=philipk@posteo.net \
    --cc=ruijie@netyu.xyz \
    /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.