help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: to big nest level of recursion


From: David Reitter
Subject: Re: to big nest level of recursion
Date: Tue, 21 Mar 2006 21:31:29 +0000

2) Pascal Bourguignon mentioned TCO. Is it relatively right recursion
handling? Why does it works only with boolean expressions? I thought
that it is enougth to make recursive call the last in the expression
(as it is in Haskell). Where can I read about it?

TCO = tail call optimization, just what you were referring to.

In Prolog, I'd formulate the algorithm just like you did. In elisp, you can't, because stack size is small and there is obviously no TCO.

http://en.wikipedia.org/wiki/Tail_recursion

Maybe it's a consolation for you that for every recursive algorithm, you can formulate an iterative version. And you don't bloat a call stack when you do so.

Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]