Re: Ugly loop



Cameron MacKinnon wrote:

> Should they be taught about the possibility that a given Lisp
> implementation may or may not optimize tail recursion? Absent
> guarantees, teaching Lisp recursion is teaching a non-portable
> technique, as code which runs fine in one Lisp may exhaust memory in
> another, and code which runs fine for small input may fail for large
> input, even though there's no obvious input size dependencies in the code.

They should be taught that a good compiler does employ tail
optimization, and that they should dump the rest that doesn't.

mkb.
.



Relevant Pages

  • Re: No tail-recursion optimize in clisp?
    ... Scheme and it has no real meaning in Common Lisp.... ... - clearly Scheme is a Lisp for which the term "proper tail recursion" ... term to Common Lisp, that is, features in Common Lisp that make TCO ...
    (comp.lang.lisp)
  • Re: Just learning lisp - tail recursion issues?
    ... This "works" fine but needs Omemory: enter tail recursion, ... My understanding is that lisp supports ... tail-recursion optimization, so that the second version ought to work ... Also, CL is not a pure functional language, and doesn't ...
    (comp.lang.lisp)
  • Re: Newbie list traversal
    ... > You may find the following function useful. ... > nil) ... If we talk about recursion in Lisp, I think it is good practise to use tail ... most Lisps resolve a tail recursion into an ...
    (comp.lang.lisp)
  • Re: No tail-recursion optimize in clisp?
    ... Tail recursion can be detected in any choice of ... proper tail recursion and stack allocation. ... could a Common Lisp interpreter. ...
    (comp.lang.lisp)
  • Re: Programmer interested in learning LISP (or not?) - recommendation?
    ... >> about it in school, but also because its power derives from ... > get it taught in schools more people will use it elsewhere" belief. ... If I serve you eggs for breakfast one morning, ... "Data structures in LISP are rather limited". ...
    (comp.lang.lisp)