[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: why tail recursion matters and why Java isn't it, was Re: lispperformance was Re: problems with lisp

Guy Steele - Sun Microsystems Labs wrote:
>    Date: Thu, 04 Sep 2003 10:48:00 +0200
>    From: Pascal Costanza <costanza@iai.uni-bonn.de>
>    To: ll1-discuss@ai.mit.edu
>    You seem to suggest that recursion is always the most "natural" solution 
>    but that's just not true. In many cases, an iteration expresses much 
>    more clearly the intention of a programmer. Here are three Common Lisp 
>    versions of an example of a collector I repeatedly need in a current 
>    project:

> Of course, if you "repeatedly need" it, then defining a function
> is exactly what you should be doing.

Of course. However, in the project I have mentioned I can't use higher 
order functions or other abstractions that would allow me to do this. 
(Or I simply don't know how to do it yet.)

> Or use (mapcar #'car list).

...this is also why I haven't thought of this one - because 
unfortunately, I have to be in a mode that makes me not think about it. :}

(I am trying to prove something with ACL2. I really miss LOOP and 
mapcar. ;-)


Pascal Costanza               University of Bonn
mailto:costanza@web.de        Institute of Computer Science III
http://www.pascalcostanza.de  Römerstr. 164, D-53117 Bonn (Germany)