From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ruijie Yu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#62037: (proper-list-p '#1=(a #1#)) => 2. It should return nil. Date: Fri, 31 Mar 2023 12:35:49 +0800 Message-ID: References: <873562jylh.fsf@posteo.net> <87y1nuw4p3.fsf@posteo.net> Reply-To: Ruijie Yu Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33184"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.8.14; emacs 30.0.50 Cc: Alan Mackenzie , 62037@debbugs.gnu.org To: Philip Kaludercic Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 31 06:47:30 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 1pi6fh-0008VQ-Gw for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 31 Mar 2023 06:47:29 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pi6fL-0001He-F7; Fri, 31 Mar 2023 00:47:07 -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 1pi6fH-0001HK-AC for bug-gnu-emacs@gnu.org; Fri, 31 Mar 2023 00:47:03 -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 1pi6fG-0002Jk-L4 for bug-gnu-emacs@gnu.org; Fri, 31 Mar 2023 00:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pi6fG-0008A8-FQ for bug-gnu-emacs@gnu.org; Fri, 31 Mar 2023 00:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ruijie Yu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 31 Mar 2023 04:47:02 +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.168023801031358 (code B ref 62037); Fri, 31 Mar 2023 04:47:02 +0000 Original-Received: (at 62037) by debbugs.gnu.org; 31 Mar 2023 04:46:50 +0000 Original-Received: from localhost ([127.0.0.1]:60069 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pi6f4-00089i-69 for submit@debbugs.gnu.org; Fri, 31 Mar 2023 00:46:50 -0400 Original-Received: from netyu.xyz ([152.44.41.246]:45834 helo=mail.netyu.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pi6f3-00089b-85 for 62037@debbugs.gnu.org; Fri, 31 Mar 2023 00:46:49 -0400 Original-Received: from fw.net.yu.netyu.xyz ( [27.18.235.88]) by netyu.xyz (OpenSMTPD) with ESMTPSA id 5415f575 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 31 Mar 2023 04:46:47 +0000 (UTC) In-reply-to: <87y1nuw4p3.fsf@posteo.net> 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:258959 Archived-At: >> [...] >>> 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=E2=80=99s 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=3D(a . #1#) is clearly circular. proper-list-p should return >> nil for it. > > But (proper-list-p '#1=3D(a . #1#)) does return nil? [...] > > because #1=3D(a #1#)) is not a circular list, the cadr only has a > reference back to a the beginning of the list, but #1=3D(a . #1#)) is > cyclical because as you say a cdr points back to a previous cons cell: > [...] > >> 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. > [...] So, it all boils down to the fact that the current documentation is lacking and/or ambiguous, in terms of "the purpose of `proper-list-p'", as well as the two definitions of the adjective "circular", which are not interchangeable in different contexts. If we all agree that only some pieces of documentation need updating, then I will try to come up with a patch(set) in the upcoming few days -- or someone else can, should one volunteers to do so. FTR, I am still waiting for a counter signature from FSF. --=20 Best, RY