[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Tail Recursion in Common Lisp ???
- To: "Bernard S. Greenberg" <BSG@SCRC-STONY-BROOK.ARPA>
- Subject: Tail Recursion in Common Lisp ???
- From: "Scott E. Fahlman" <Fahlman@C.CS.CMU.EDU>
- Date: Thu, 17 Jul 1986 15:11:00 -0000
- Cc: Common-Lisp@SU-AI.ARPA
- In-reply-to: Msg of 17 Jul 1986 10:53-EDT from Bernard S. Greenberg <BSG at STONY-BROOK.SCRC.Symbolics.COM>
- Sender: FAHLMAN@C.CS.CMU.EDU
"8/9 of this can of worms is below the surface". If the spec -allows-
tail-recursion optimization, and "my" implementation "supports"
tail-recursion, then "I" can, and most likely -will-, write a
"tail-recursive" program, which is theoretically portable, but in fact,
will blow the stack of most certified implementations that do not
"support" tail-recursion, and is thus, subtly, not portable.
There are a million issues like this. For example, Common Lisp will
also allow theoretically portable programs that are 10 megabytes in
size, and that will blow the memory on small, non-virtual-memory
machines. We don't want to outlaw large programs or efficient compilers
or any compilation technique that leads to more effective use of
resources just because not everyone will have it and someone might be
screwed by that.
Portability is an important goal of Common Lisp, but not the only goal.
The best we can do in this case is to spell out clearly what is allowed
and what is required, and let programmers decide whether they want to
depend on non-required efficiency mechanisms, knowing that not all
machines will have them.