CL Implementations and Tail-Call Elimination
- From: Pillsy <pillsbury@xxxxxxxxx>
- Date: Mon, 10 Sep 2007 09:59:37 -0700
Every once in a while, a newbie comes along working through a problem
where they use recursion to do iteration, and usually one of the first
things anyone suggests is that they switch over to using DOLIST or
LOOP or something. In and of itself, this is perfectly good advice,
but one of the reasons always cited (and I cite it too) is that you
can't rely on an ANS Common Lisp implementation to eliminate tail
calls, the way you can rely on a Scheme implementation to do that.
However, it looks to me like CL implementations really usually will do
that sort of elimination, at least with the right set of declarations.
So I'm sort of wondering which common Common Lisps don't do that. I
blithely rely on it since SBCL does it, and I want to know whether
this is a mildly bad habit or a really bad habit, at least from a
portability standpoint.
Cheers,
Pillsy
.
- Follow-Ups:
- Re: CL Implementations and Tail-Call Elimination
- From: Pascal Costanza
- Re: CL Implementations and Tail-Call Elimination
- From: Scott Burson
- Re: CL Implementations and Tail-Call Elimination
- From: Rainer Joswig
- Re: CL Implementations and Tail-Call Elimination
- From: pineapple . link
- Re: CL Implementations and Tail-Call Elimination
- From: fortunatus
- Re: CL Implementations and Tail-Call Elimination
- Prev by Date: Re: simple lisp interpreter
- Next by Date: grammatical complexity [was: Re: simple lisp interpreter]
- Previous by thread: (setq a ... ) vs (set 'a ... )
- Next by thread: Re: CL Implementations and Tail-Call Elimination
- Index(es):
Relevant Pages
|