From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#55395: What does (1 2 3 . #2) mean? Date: Fri, 13 May 2022 13:32:34 +0200 Message-ID: <4B70C9BE-B784-4B74-A081-7A8B3F8D5136@acm.org> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29648"; mail-complaints-to="usenet@ciao.gmane.io" To: 55395@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 13 13:41:12 2022 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 1npTfU-0007WK-FY for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 13 May 2022 13:41:12 +0200 Original-Received: from localhost ([::1]:56402 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1npTfT-0008BY-G4 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 13 May 2022 07:41:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46686) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npTfK-0008Az-Dg for bug-gnu-emacs@gnu.org; Fri, 13 May 2022 07:41:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49140) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1npTfK-00080v-49 for bug-gnu-emacs@gnu.org; Fri, 13 May 2022 07:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1npTfK-00057r-2E for bug-gnu-emacs@gnu.org; Fri, 13 May 2022 07:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 May 2022 11:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 55395 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.165244205219674 (code B ref -1); Fri, 13 May 2022 11:41:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 13 May 2022 11:40:52 +0000 Original-Received: from localhost ([127.0.0.1]:43037 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npTfA-00057G-Aa for submit@debbugs.gnu.org; Fri, 13 May 2022 07:40:52 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:37244) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npTf9-000579-DD for submit@debbugs.gnu.org; Fri, 13 May 2022 07:40:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46636) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npTf9-00088n-6f for bug-gnu-emacs@gnu.org; Fri, 13 May 2022 07:40:51 -0400 Original-Received: from mail1448c50.megamailservers.eu ([91.136.14.48]:58096 helo=mail265c50.megamailservers.eu) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npTf5-0007sr-Ov for bug-gnu-emacs@gnu.org; Fri, 13 May 2022 07:40:50 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1652441556; bh=HsYx8ZyZPXmKdd+srh2sjIXA6QATRhdgKCR/ONylZsY=; h=From:Subject:Date:To:From; b=e/DVgB7dR8TxrSeJPNND2HAZFjDsOAkl4YFrWK5fDOJGzME2yrRmiiYkeVmsO3BcG ZBsTb8yRdYVluFYEvLW/i6Rc0tFUvrSDsw8loBGB/BgJ4fO5tR16y68V1Ujz4OjPDW gTEtFocMn7j24lZdj57XTFdUcQyLeKj76iqxJEJ4= Feedback-ID: mattiase@acm.or Original-Received: from smtpclient.apple (c188-150-171-71.bredband.tele2.se [188.150.171.71]) (authenticated bits=0) by mail265c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 24DBWYbx028640 for ; Fri, 13 May 2022 11:32:36 +0000 X-Mailer: Apple Mail (2.3654.120.0.1.13) X-CTCH-RefID: str=0001.0A742F17.627E41D4.0038, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-Origin-Country: SE Received-SPF: softfail client-ip=91.136.14.48; envelope-from=mattiase@acm.org; helo=mail265c50.megamailservers.eu X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action 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" Xref: news.gmane.io gmane.emacs.bugs:232121 Archived-At: What, exactly, does the #N print notation mean (with print-circle=3Dnil)? Let's define (rho LEAD LOOP) as the iota list that has a loop LOOP long = after LEAD initial elements: (defun rho (lead loop) (let ((l (number-sequence 1 (+ lead loop)))) (setcdr (nthcdr (+ lead loop -1) l) (nthcdr lead l)) l)) Then we have: (rho 0 1) =3D> (1 . #0) (rho 0 2) =3D> (1 2 1 2 . #2) (rho 0 3) =3D> (1 2 3 1 2 . #2) (rho 0 4) =3D> (1 2 3 4 1 2 3 4 1 2 . #5) (rho 0 5) =3D> (1 2 3 4 5 1 2 3 4 5 1 . #5) (rho 1 4) =3D> (1 2 3 4 5 2 3 4 5 2 . #5) (rho 4 1) =3D> (1 2 3 4 5 5 5 . #3) and so on. The pattern is not obvious to me. It may have made more sense before the switch of cycle-detection = algorithm from Floyd to Brent. This can be fixed by hand-coding the list = iteration and explicitly remembering the index of the tortoise, but = would that be correct? What's the spec? If #N means 'Nth object from the top along the path to the current = object, starting at 0' then we should have (rho 2 3) =3D> (1 2 3 4 5 . #2) (list (rho 2 3)) =3D> ((1 2 3 4 5 . #3)) ie, adding the print depth to the index in the list. Do you agree?