From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: pjb@informatimago.com (Pascal J. Bourguignon) Newsgroups: gmane.emacs.help Subject: Re: What is the best way to navigate #ifdef and #endif in C program Date: Fri, 06 Aug 2010 15:55:36 +0200 Organization: Informatimago Message-ID: <87vd7nvo9z.fsf@kuiper.lan.informatimago.com> References: <53f62f81-fb10-4fb6-87ce-0eb5609d12f5@h17g2000pri.googlegroups.com> <87y6cmsmf1.fsf@kuiper.lan.informatimago.com> <57db02c5-32db-4483-863e-a9177e4e6003@w30g2000yqw.googlegroups.com> <8c27aoFij2U1@mid.individual.net> <27e5f238-760f-4fee-93ce-0b9ce04741e8@5g2000yqz.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1291856467 30932 80.91.229.12 (9 Dec 2010 01:01:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Dec 2010 01:01:07 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 09 02:01:02 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PQUsW-0001qf-3p for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 02:01:00 +0100 Original-Received: from localhost ([127.0.0.1]:41784 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQUsV-0005U0-Gw for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 20:00:59 -0500 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.lang.lisp,comp.lang.scheme Original-Lines: 34 Original-X-Trace: individual.net ue7hXsogBk5wdvgKjlTgqw5nwTdqnwupQ4iHMc6IgnTVpWftQ3 Cancel-Lock: sha1:MTA0MTVjZWY1ZWZjN2RlY2U0Y2Y3Yjc5ZWYxMGEyNDk5Y2FiOWY5MQ== sha1:32cgvgKNqoS6QszaruPTQA76re0= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en X-Disabled: X-No-Archive: no User-Agent: Gnus/5.101 (Gnus v5.10.10) Emacs/23.2 (gnu/linux) Original-Xref: usenet.stanford.edu gnu.emacs.help:180462 comp.lang.lisp:290982 comp.lang.scheme:87290 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 Xref: news.gmane.org gmane.emacs.help:76341 Archived-At: Elena writes: > On Aug 6, 10:43 am, Pascal Costanza wrote: >> Here is a way how to do TCO in Common Lisp:http://groups.google.com/group/comp.lang.lisp/msg/8f9dcf58a00aca27 >> >> It can't be implemented as just a macro, because it requires the >> cooperation of different parts of a program. You can only do that as a >> "real" language extension. > > Thanks for the link, Pascal. > > IMHO, that would be a better way to make TCO available, that is: TCO > should be explicit, since you know beforehand whether you want your > function to be tail recursive or not. Then, whenever you fail to > implement a tail recursion among mutually recursive functions, the > compiler should complain. If I'm not mistaken, OCaml has (somewhat) > explicit TCO. Or detecting such errors would better be left to test > cases? You're all forgetting something. In Common Lisp, most tail calls ARE NOT tail calls. This is because of dynamic binding. Not only of variables, but also of unwind frames, a lot of them are hidden in with-* macros, catch frames, condition handlers, restarts, etc. So even if TCO was mandatory, it couldn't be applied often in Common Lisp programs. -- __Pascal Bourguignon__ http://www.informatimago.com/