Re: Iteration in lisp
- From: Kaz Kylheku <kkylheku@xxxxxxxxx>
- Date: Tue, 22 Apr 2008 07:34:12 -0700 (PDT)
On Apr 21, 8:34 pm, Kent M Pitman <pit...@xxxxxxxxxxx> wrote:
"rig...@xxxxxxxxx" <rig...@xxxxxxxxx> writes:
If you want to iterate through a list, should you use a recursive
function or a loop?
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.
Even if you have tail recursion, you are still wasting productivity by
writing your own list iteration instead of using the existing library
functions.
.
- References:
- Iteration in lisp
- From: rigaha@xxxxxxxxx
- Re: Iteration in lisp
- From: Kent M Pitman
- Iteration in lisp
- Prev by Date: Casio Men's Waveceptor Atomic Watch #VQ201HDA-8BV - Replica Watch Fake
- Next by Date: Re: Iteration in lisp
- Previous by thread: Re: Iteration in lisp
- Next by thread: Re: Iteration in lisp
- Index(es):
Relevant Pages
|