From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andreas Schwab Newsgroups: gmane.emacs.bugs Subject: bug#55395: What does (1 2 3 . #2) mean? Date: Fri, 13 May 2022 18:08:33 +0200 Message-ID: <87czghl8ji.fsf@igel.home> References: <4B70C9BE-B784-4B74-A081-7A8B3F8D5136@acm.org> 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="4460"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) Cc: 55395@debbugs.gnu.org To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 13 18:41:02 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 1npYLd-0000zB-GP for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 13 May 2022 18:41:01 +0200 Original-Received: from localhost ([::1]:51470 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1npYLc-00052p-DV for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 13 May 2022 12:41:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52708) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npXqg-0006CF-CC for bug-gnu-emacs@gnu.org; Fri, 13 May 2022 12:09:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50945) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1npXqg-0003zS-2T for bug-gnu-emacs@gnu.org; Fri, 13 May 2022 12:09:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1npXqf-0006fc-SN for bug-gnu-emacs@gnu.org; Fri, 13 May 2022 12:09:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andreas Schwab Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 May 2022 16:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55395 X-GNU-PR-Package: emacs Original-Received: via spool by 55395-submit@debbugs.gnu.org id=B55395.165245812025600 (code B ref 55395); Fri, 13 May 2022 16:09:01 +0000 Original-Received: (at 55395) by debbugs.gnu.org; 13 May 2022 16:08:40 +0000 Original-Received: from localhost ([127.0.0.1]:44842 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npXqJ-0006eq-Qh for submit@debbugs.gnu.org; Fri, 13 May 2022 12:08:40 -0400 Original-Received: from mail-out.m-online.net ([212.18.0.9]:57703) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npXqH-0006eg-2S for 55395@debbugs.gnu.org; Fri, 13 May 2022 12:08:38 -0400 Original-Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4L0D8g4VJRz1qybr; Fri, 13 May 2022 18:08:35 +0200 (CEST) Original-Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4L0D8g39Hjz1qqkB; Fri, 13 May 2022 18:08:35 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Original-Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id Vfgoa4-DvHHn; Fri, 13 May 2022 18:08:34 +0200 (CEST) X-Auth-Info: /YfvqwbtfDzbo2lkZopqlppNxSz06UWEnkMseA7Y3x9+3UmifpaEawjFSInJYjA5 Original-Received: from igel.home (ppp-46-244-176-172.dynamic.mnet-online.de [46.244.176.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Fri, 13 May 2022 18:08:34 +0200 (CEST) Original-Received: by igel.home (Postfix, from userid 1000) id EC87E2C39F5; Fri, 13 May 2022 18:08:33 +0200 (CEST) X-Yow: NANCY!! Why is everything RED?! In-Reply-To: <4B70C9BE-B784-4B74-A081-7A8B3F8D5136@acm.org> ("Mattias =?UTF-8?Q?Engdeg=C3=A5rd?="'s message of "Fri, 13 May 2022 13:32:34 +0200") 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:232174 Archived-At: On Mai 13 2022, Mattias EngdegÄrd wrote: > 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) => (1 . #0) > (rho 0 2) => (1 2 1 2 . #2) > (rho 0 3) => (1 2 3 1 2 . #2) > (rho 0 4) => (1 2 3 4 1 2 3 4 1 2 . #5) > (rho 0 5) => (1 2 3 4 5 1 2 3 4 5 1 . #5) > (rho 1 4) => (1 2 3 4 5 2 3 4 5 2 . #5) > (rho 4 1) => (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? I don't think there is a defined meaning behind the number, it's more an implementation detail. If you want to have precise cycle detection you need to enable print-circle. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."