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

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

Re: tail call reduction


From: Stefan Monnier
Subject: Re: tail call reduction
Date: Thu, 10 Feb 2005 23:50:11 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux)

> I don't recall the actual cases where I bumped into problems. IIRC I
> got beyond `max-lisp-eval-depth' once or twice with recursive
> functions on a depth-first traversal of medium-sized trees. Since the
> default of said variable is 300, this should be o.k.. Hm, well, I
> guess it was with a loop implemented by recursive calls.

The depth used by Emacs might be significantly smaller if the code is
byte-compiled.  And you can bump up the max-lisp-eval-depth (you can even
bump it locally inside your code with a let-binding).

Or you can change your algorithm to use trees that are better balanced and
will thus not be so deep (though not always if you're using something like
splay trees).


        Stefan

reply via email to

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