On Aug 4, 2009, at 06:17, Andy Wingo wrote:
Hello!
(Was away for the weekend, but back hacking all week now.)
Welcome back!
On Thu 30 Jul 2009 22:18, Neil Jerram <n...@ossau.uklinux.net> writes:
Daniel Kraft <d...@domob.eu> writes:
Lambda arguments are still always dynamically bound, which is
quite a
pity as it inhibits tail-call optimization;
Indeed, a pity. Though self-tail calls can be optimized... still,
irritating.
In the compiler, or in the byte-code engine?
The Emacs byte compiler does not do self-tail call optimizations.
Since the function value of a symbol can be copied out and/or replaced
(and Emacs ships with the "advice" package which does both), the
symbol's function value may wind up not being the function body being
compiled; turning a self-tail call into a jump back to the beginning
would cause observable behavior changes from what happens now.
On the other hand, I haven't looked at what elisp compiles to in
Guile; maybe it's possible to have the byte-code engine detect when
you're making a tail call to yourself (such as recursive calls when
the function value slot hasn't been messed with) and optimize them on
the fly?
Ken