Re: Stack overflow in relatively simple programs



On Sun, 31 Dec 2006 05:08:54 +0100, Pascal Bourguignon <pjb@xxxxxxxxxxxxxxxxx>
tried to confuse everyone with this message:

Dan Bensen <randomgeek@xxxxxxxxxxxxxx> writes:

fairchild.anthony@xxxxxxxxx wrote:
I believe this is more a problem with your algorithms and not Lisp.

Nothing but tail calls there. What's wrong with them?

Common Lisp doesn't specify anything relative to tail calls.
Implementations don't necessarily implement tail call optimization.
clisp doesn't on interpreted code, to ease debugging.


But, it needs to be said, if you compile this code, the programs work just fine.

(compile 'new-primes)

and so on...

--
|Don't believe this - you're not worthless ,gr---------.ru
|It's us against millions and we can't take them all... | ue il |
|But we can take them on! | @ma |
| (A Wilhelm Scream - The Rip) |______________|
.



Relevant Pages

  • Re: Stack overflow in relatively simple programs
    ... Common Lisp doesn't specify anything relative to tail calls. ... Implementations don't necessarily implement tail call optimization. ...
    (comp.lang.lisp)
  • Re: new to the condition system
    ... sometimes calls handler-fn, increasing stack depth. ... It's tail calls. ... I'm sympathetic to the desire of implementations to ...
    (comp.lang.lisp)
  • Re: CL implementations and tail-call optimization
    ... All major implementations support tail call optimization, but none guarantees that it will work when you need it, and commercial ones are not necessarilly better in this respect. ... I routinely face the need to unroll tail-calls manually because either Lispworks or Allegro Common Lisp fail to eliminate them, either due to bugs or due to limitations of the implementation. ...
    (comp.lang.lisp)
  • Re: Term Rewriting vs. Functional Programming
    ... the compiler optimizes tail calls. ... > quite happy with a simple syntactic definition of tail calls, ... > reason about the space usage of their programs. ... - Don't specify unless you specify completely enough so that the ...
    (comp.lang.functional)
  • dont try to search incidentally while youre causing at times a registered significance
    ... then Paul thus criticizes a lucky border due to ... Well, I'll comply the tail. ... It should obviously specify on lean peculiar navels. ... handicapped midnight. ...
    (sci.crypt)