From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: tail call reduction Date: Thu, 10 Feb 2005 09:56:55 -0500 Organization: Bell Sympatico Message-ID: <87psz831tp.fsf-monnier+gnu.emacs.help@gnu.org> References: <87k6pgwy7u.fsf@ID-87814.user.uni-berlin.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1108048614 10464 80.91.229.2 (10 Feb 2005 15:16:54 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 10 Feb 2005 15:16:54 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Feb 10 16:16:54 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1CzG3h-0006hq-N0 for geh-help-gnu-emacs@m.gmane.org; Thu, 10 Feb 2005 16:16:45 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CzGIS-0008Cr-Bu for geh-help-gnu-emacs@m.gmane.org; Thu, 10 Feb 2005 10:32:00 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!wns13feed!worldnet.att.net!207.35.177.252!nf3.bellglobal.com!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux) Cancel-Lock: sha1:sw/46Z4ccwdzKAX3IsTqNMFWlF4= Original-Lines: 17 Original-NNTP-Posting-Host: 65.92.240.235 Original-X-Complaints-To: abuse@sympatico.ca Original-X-Trace: news20.bellglobal.com 1108047415 65.92.240.235 (Thu, 10 Feb 2005 09:56:55 EST) Original-NNTP-Posting-Date: Thu, 10 Feb 2005 09:56:55 EST Original-Xref: shelby.stanford.edu gnu.emacs.help:128480 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org X-MailScanner-To: geh-help-gnu-emacs@m.gmane.org Xref: main.gmane.org gmane.emacs.help:24012 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:24012 > My main pet Emacs Lisp programming project involves both a lot of > parsing and recursively descending of tree-like data structures. Can you give a short description of one such case where you've bumped into problems. After all, the lack of tail-recursion should only be a problem when you implement loops by recursive calls, but unless your tree data-structures are very deep, normal recursion should fine. > But, alas, unless I am much mistaken, proper tail recursion is simply > impossible in a dynamically scoped environment. I could reduce byte I recommend you check out the lexbind branch which introduces static scoping (it still provides dynamic scoping as well, but it should allow tail-call elimination in most simple cases). Stefan