Re: Iteration in lisp
- From: Kent M Pitman <pitman@xxxxxxxxxxx>
- Date: 22 Apr 2008 23:00:55 -0400
"John Thingstad" <jpthing@xxxxxxxxx> writes:
På Tue, 22 Apr 2008 05:34:34 +0200, skrev Kent M Pitman
<pitman@xxxxxxxxxxx>:
In Common Lisp, always prefer a loop where practical unless you know
with relative certainty that the problem cannot grow very big. A
recursive function can run out of stack since CL does not guarantee
tail call elimination. Anyone who tells you otherwise is living in a
fantasy world or is telling you something implementation-dependent or
is confusing Lisp with Scheme.
Fantasy world? Nearly all compilers seem to do tail call elimination
with the default settings.
My remarks were directed not any user making a properly informed
choice, but at someone advising ("anyone who tells you") if they do
not properly qualify their remarks as non-portable. When I speak of
Common Lisp, I generally mean "any Common Lisp"; when I want to talk about
a particular implementation, I tend to identify that.
There are a great many ways one can legitimately program if one knows
the assumptions one is making and has examined the risks. But the
language definition is what it is, and pretending it's not what it is
for the sake of easier explanation is the fantasy to which I was
referring.
I have recently remarked that I don't like the default CL treatment of
SETQ and that I tend to program in a non-portable fashion. I don't disagree
that this will create problems. I don't recommend others ignore the fact
that the standard makes this issue dicey. I think as long as people know the
truth, they can make an informed decision.
.
- Follow-Ups:
- Re: Iteration in lisp
- From: Robert Maas, http://tinyurl.com/uh3t
- Re: Iteration in lisp
- References:
- Iteration in lisp
- From: rigaha@xxxxxxxxx
- Re: Iteration in lisp
- From: Kent M Pitman
- Re: Iteration in lisp
- From: John Thingstad
- Iteration in lisp
- Prev by Date: Re: Ruby performance woes
- Next by Date: Designer Coach Classic Signature Tote Coffee 8k49coffee Handbags, Replica, Fake
- Previous by thread: Re: Iteration in lisp
- Next by thread: Re: Iteration in lisp
- Index(es):
Relevant Pages
|