[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Tail Recursion in Common Lisp ???
- To: "David C. Plummer" <DCP@scrc-quabbin.ARPA>
- Subject: Re: Tail Recursion in Common Lisp ???
- From: firstname.lastname@example.org
- Date: Fri, 18 Jul 1986 15:55:00 -0000
- Cc: Common-Lisp@su-ai.ARPA
- In-reply-to: Your message of Thu, 17 Jul 86 22:38 EDT. <860717223819.0.DCP@FIREBIRD.SCRC.Symbolics.COM>
I hope this issue has not been rehashed too many times -- I have not
been reading this list for long.
Scheme at MIT left out iterative constructs as a pedagogical
exercise, both to show that it was practical and to force
students (who are usually familiar with iterative constructs)
to think recursively. Syntactic sugar for iteration (e.g. DO)
appears in the new Scheme standard, and is acknowledged by most
Scheme people to be a useful way of thinking about many problems.
An implementation of Common Lisp that does not do tail recursion is
just a bad implementation. Specifications of resource optimizations
do not belong in the language spec; it is up to the buyers/users to be
aware of the limitations of an implementation. Buying a Common Lisp
which lacks tail recursion is like buying a car with a 2-pint gas
tank -- it'll get you moving, but not too far.
There is a legitimate worry here. If programmers believe (as ZetaLISP
programmers do) that recursion is a bad thing because of resource
constraints, they won't use one of the two most useful styles of
programming in Lisp. Instead of putting a requirement in the
language, the common wisdom should be that a Common Lisp without tail
recursion (or a compiler, which should go much further in static
analysis of resource usage) is not to be taken seriously. Then we can
all assume it, much as C programmers assume at least 2K words of
stack. Otherwise portable code will avoid it, and all Common Lisp
programmers will be the poorer.