[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
tail recursion, again
Date: Tue, 11 Sep 90 12:14 EDT
From: RWK@fuji.ila.com (Robert W. Kerns)
...that unbridled, unbounded-depth recursion is a bug in
your program that should be fixed by using a more
appropriate algorithm, not by complaining about the
lack of this optimization.
Tail recursion optimization is NOT part of the language.
If you really wanted to explicitly program in such a style, you could define
a macro for a calling protocol that (conditionally on the compiler) expanded
into either a regular recursive call or a rewrite using iteration.
I think kanderso@bbn.com sent a message suggesting this back in March.
Why do people get hung on up wanting tail recursion?
Well, Steele used it in his myth debunking efforts, and of course alot of
people who get properly introduced to Lisp are taught Scheme.
I also just noticed that Winston's Lisp book (3d edition), which purports to
describe Common Lisp, explicitly says that, "tail recursive procedures are
handled extremely efficiently by most modern Lisp systems."