Re: Stack overflow in relatively simple programs



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

Pascal Bourguignon wrote:
clisp doesn't on interpreted code, to ease debugging.
Interesting. That sounds like the answer to the OP.

In any case, what's recursive in primes?
Nothing that a simple loop can't handle. I just didn't see any obvious blunders in the code.

--
Dan
www.prairienet.org/~dsb
.



Relevant Pages

  • Re: Format puzzle
    ... (loop for tail on list ... collect (list (first tail) ... do (princ (first tail) s) ...
    (comp.lang.lisp)
  • Re: Cost of closures
    ... the tail calls are replaced by a DO loop. ... why Chez Scheme runs slower on the DO loop version. ... executed in Larceny are that Larceny has one unnecessary ...
    (comp.lang.lisp)
  • Re: Beginner Question for knitting...casting on???
    ... You make a loop around your left thumb with the tail yarn, then knit the loop onto the needle, using the ball yarn. ...
    (rec.crafts.textiles.needlework)
  • Re: CAS, Lambda Calculus, Continuation and Functional Programming
    ... >>Recursion that's equivalent to loops can always be optimized back into ... and that tail calls are equivalent to loops. ... If a loop is formulated in a recursive way then ... >> that makes tail call elimination less attractive for compiler writers. ...
    (sci.math.symbolic)
  • Re: Term Rewriting vs. Functional Programming
    ... > programs assume that tail recursion runs in constant space. ... > tail call elimination. ... Reasonable implementations, of course, ... > fun loop b = loop ...
    (comp.lang.functional)