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: "and" operations
    ... Scheme (a dialect of Lisp) was taught as an introductory programming ...
    (comp.lang.c)
  • 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: "and" operations
    ... MMcL> theoretically very important. ... Scheme (a dialect of Lisp) was taught as an introductory programming ...
    (comp.lang.c)
  • Re: "and" operations
    ... MMcL> theoretically very important. ... Scheme (a dialect of Lisp) was taught as an introductory programming ... been a fixture at MIT since the 1960's. ...
    (comp.lang.c)