From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#62037: (proper-list-p '#1=(a #1#)) => 2. It should return nil. Date: Sat, 18 Mar 2023 08:29:02 +0000 Message-ID: References: <873562jylh.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33423"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Ruijie Yu , 62037@debbugs.gnu.org To: Philip Kaludercic Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 18 09:30:18 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pdRxB-0008Yk-J8 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 18 Mar 2023 09:30:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pdRwy-0006PV-W2; Sat, 18 Mar 2023 04:30:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pdRww-0006PF-HO for bug-gnu-emacs@gnu.org; Sat, 18 Mar 2023 04:30:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pdRww-0005G6-8Q for bug-gnu-emacs@gnu.org; Sat, 18 Mar 2023 04:30:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pdRww-0004rj-0G for bug-gnu-emacs@gnu.org; Sat, 18 Mar 2023 04:30:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 Mar 2023 08:30:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62037 X-GNU-PR-Package: emacs Original-Received: via spool by 62037-submit@debbugs.gnu.org id=B62037.167912815418603 (code B ref 62037); Sat, 18 Mar 2023 08:30:01 +0000 Original-Received: (at 62037) by debbugs.gnu.org; 18 Mar 2023 08:29:14 +0000 Original-Received: from localhost ([127.0.0.1]:46140 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pdRw9-0004py-IA for submit@debbugs.gnu.org; Sat, 18 Mar 2023 04:29:13 -0400 Original-Received: from mx3.muc.de ([193.149.48.5]:41440) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pdRw6-0004pd-PT for 62037@debbugs.gnu.org; Sat, 18 Mar 2023 04:29:11 -0400 Original-Received: (qmail 99076 invoked by uid 3782); 18 Mar 2023 09:29:03 +0100 Original-Received: from acm.muc.de (p4fe155b2.dip0.t-ipconnect.de [79.225.85.178]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 18 Mar 2023 09:29:03 +0100 Original-Received: (qmail 5271 invoked by uid 1000); 18 Mar 2023 08:29:02 -0000 Content-Disposition: inline In-Reply-To: <873562jylh.fsf@posteo.net> X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:258141 Archived-At: Hello, Philip. On Sat, Mar 18, 2023 at 07:41:14 +0000, Philip Kaludercic wrote: > Ruijie Yu 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).