|
From: | Pascal Costanza |
Subject: | Re: What is the best way to navigate #ifdef and #endif in C program |
Date: | Wed, 08 Dec 2010 15:23:26 -0000 |
User-agent: | Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.7) Gecko/20100713 Thunderbird/3.1.1 |
On 05/08/2010 21:04, Elena wrote:
On 4 Ago, 17:09, Peter Keller<psil...@cs.wisc.edu> wrote:Specifically:http://letoverlambda.com/index.cl/guest/chap5.html#sec_4 Would show you how to write a macro such that it adds Scheme's tail call optimized "named let" into Common Lisp. This goes beyond the concept of syntactic sugar and enters the domain of pure code transformation.Indeed, code transformation is what sets CL's macros apart. However, TCO is much more than that. Read here: http://stackoverflow.com/questions/2181852/tail-call-elimination-in-clojure However, TCO could also just not be possible in CL because of its design: http://www.cliki.net/Tail%20Recursion
Here is a way how to do TCO in Common Lisp: http://groups.google.com/group/comp.lang.lisp/msg/8f9dcf58a00aca27It 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.
Macros provide "only" syntactic sugar, in the sense that they perform only local program transformations.
Pascal -- My website: http://p-cos.net Common Lisp Document Repository: http://cdr.eurolisp.org Closer to MOP & ContextL: http://common-lisp.net/project/closer/
[Prev in Thread] | Current Thread | [Next in Thread] |