From Michael_Heerdegen@web.de Wed Aug 20 06:56:19 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-7.8 required=4.0 tests=AWL,BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 20 Aug 2008 13:56:19 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m7KDuFYQ005006 for ; Wed, 20 Aug 2008 06:56:17 -0700 Received: from mail.gnu.org ([199.232.76.166]:49866 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1KVo9H-0001Ft-DD for emacs-pretest-bug@gnu.org; Wed, 20 Aug 2008 09:54:55 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1KVoAT-0000Tx-US for emacs-pretest-bug@gnu.org; Wed, 20 Aug 2008 09:56:14 -0400 Received: from fmmailgate01.web.de ([217.72.192.221]:45710) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KVoAT-0000TW-HX for emacs-pretest-bug@gnu.org; Wed, 20 Aug 2008 09:56:09 -0400 Received: from smtp05.web.de (fmsmtp05.dlan.cinetic.de [172.20.4.166]) by fmmailgate01.web.de (Postfix) with ESMTP id 8157EEB8BFE1 for ; Wed, 20 Aug 2008 15:56:05 +0200 (CEST) Received: from [217.185.137.22] (helo=debian) by smtp05.web.de with asmtp (WEB.DE 4.109 #226) id 1KVoAO-00037w-00 for emacs-pretest-bug@gnu.org; Wed, 20 Aug 2008 15:56:04 +0200 From: Michael Heerdegen To: emacs-pretest-bug@gnu.org Subject: Elisp: lexical-let and cyclic structures Reply-to: michael_heerdegen@web.de Date: Wed, 20 Aug 2008 15:57:16 +0200 Message-Id: <1219240636.0@debian> Sender: Michael_Heerdegen@web.de X-Sender: michael_heerdegen@web.de X-Provags-ID: V01U2FsdGVkX18g64pMWVCWpWPcfiYzXqe+V4YfbnpJ//DeWIAe /e+Nqnx7i/AtPVV3/EnlKYTDXPkVw0RzjNCDYrUGJzWAJpV9ql i/BOocuL7wVCdrUjEEvg== X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 When using the reader constructs `#N=' and `#N#' for cyclic structures, lexical-let sometimes produces errors which don't occur with let. Example: Eval the following: (defun f (start) (lexical-let (start start) ;; return a closure #1=(lambda (x) (if (= x start) x (+ x (#1# (1- x))))))) Then evaluating f ends with an error: (f 3) "Variable binding depth exceeds max-specpdl-size" The problem also occurs without lambdas. Examples: (let () '#1=(#1#)) ;; ==> (#0) (lexical-let () '#1=(#1#)) ;; Error (let ((x '#1=(#1#))) (lexical-let () x)) ;; ==> (#0) `#1=(#1#) ;; Error From monnier@iro.umontreal.ca Wed Aug 20 18:12:36 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-7.3 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 748) by emacsbugs.donarmstrong.com; 21 Aug 2008 01:12:36 +0000 Received: from smtp-04.arnet.com.ar (smtp-04.arnet.com.ar [200.45.191.26]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id m7L1CTmC025778 for <748@emacsbugs.donarmstrong.com>; Wed, 20 Aug 2008 18:12:33 -0700 Received: (qmail 11956 invoked from network); 21 Aug 2008 01:10:37 -0000 Received: from unknown (HELO ceviche.home) (200.117.157.213) by 0 with SMTP; 21 Aug 2008 01:10:36 -0000 Received: by ceviche.home (Postfix, from userid 20848) id E1851B404F; Wed, 20 Aug 2008 21:12:22 -0400 (EDT) From: Stefan Monnier To: 748@debbugs.gnu.org Subject: Re: bug#748: Elisp: lexical-let and cyclic structures Message-ID: References: <1219240636.0@debian> Date: Wed, 20 Aug 2008 21:12:22 -0400 In-Reply-To: <1219240636.0@debian> (Michael Heerdegen's message of "Wed, 20 Aug 2008 15:57:16 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-CrossAssassin-Score: 2 tag +748 wontfix thanks > When using the reader constructs `#N=' and `#N#' for cyclic > structures, lexical-let sometimes produces errors which don't occur > with let. Most programming languages do not accept infinite programs. Elisp is no exception. The fact that you can build cyclic abstract syntax trees and that they sometimes get evaluated correctly is just an accident. I.e. if it hurts, don't do it. > (defun f (start) > (lexical-let (start start) ;; return a closure > #1=(lambda (x) (if (= x start) x > (+ x (#1# (1- x))))))) For this case, I'd recommend to make the recursion explicit, e.g.: (defun f (start) (lexical-let ((start start)) ;; return a closure (labels ((loop (x) (if (= x start) x (+ x (loop (1- x)))))) loop))) -- Stefan From rgm@gnu.org Sat Aug 23 12:07:24 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-8.9 required=4.0 tests=AWL,BAYES_00,MISSING_SUBJECT, NOSUBJECT,RCVD_IN_DNSWL_MED,VALID_BTS_CONTROL,X_DEBBUGS_NO_ACK autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at control) by emacsbugs.donarmstrong.com; 23 Aug 2008 19:07:24 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m7NJ7L8W029282 for ; Sat, 23 Aug 2008 12:07:22 -0700 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1KWyQu-0005gg-0f; Sat, 23 Aug 2008 15:05:56 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18608.24467.973909.198641@fencepost.gnu.org> Date: Sat, 23 Aug 2008 15:05:55 -0400 From: Glenn Morris To: control X-Attribution: GM X-Mailer: VM (www.wonderworks.com/vm), GNU Emacs (www.gnu.org/software/emacs) X-Hue: red X-Ran: E)^v)5RjV}S(A5)Xg,Kml&oCfw;b:8BpQP~PA,EXpFOh",qMx@) id 1Qfbh0-0006FV-W4 for submit@debbugs.gnu.org; Sat, 09 Jul 2011 13:51:51 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qfbgz-0006FK-Jg for 748-done@debbugs.gnu.org; Sat, 09 Jul 2011 13:51:49 -0400 Received: from localhost ([127.0.0.1]:38225) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qfbgt-0003TF-Vs; Sat, 09 Jul 2011 13:51:44 -0400 From: Glenn Morris To: 748-done@debbugs.gnu.org Subject: Re: bug#748: Elisp: lexical-let and cyclic structures References: <1219240636.0@debian> X-Spook: Treasury president Perl-RSA CDMA propaganda warfare top X-Ran: :3|vkN=Y$a1upQ,/I59U&+dETSg&%$9VS)wpbA`1l{/.ZDCUfc=\QGdH<(G]Gs{a(AzD{^ X-Hue: red X-Attribution: GM Date: Sat, 09 Jul 2011 13:51:43 -0400 In-Reply-To: (Stefan Monnier's message of "Wed, 20 Aug 2008 21:12:22 -0400") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -6.4 (------) X-Debbugs-Envelope-To: 748-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.4 (------) I don't see a need to keep open this particular report, which was marked "wontfix" some time ago. Stefan Monnier wrote: > Most programming languages do not accept infinite programs. Elisp is > no exception. The fact that you can build cyclic abstract syntax trees > and that they sometimes get evaluated correctly is just an accident. > > I.e. if it hurts, don't do it. From unknown Tue Jun 17 01:40:32 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 07 Aug 2011 11:24:12 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator