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

Issue: TAIL-RECURSION-OPTIMIZATION (Version 1)



This is not tail-recursion optimization.  This is more properly called
EARLY-FUNCTION-BINDING.  As it happens, early function binding is
often combined with tail-recursion optimization in the case of self
calls.  This has led to some confusion between the two, but in fact
they are orthogonal.  To clarify, tail-recursion optimization means
not consuming stack space for a function call when the result of that
call will be the result of the function making the call.  Early
function binding means committing to a particular function definition
for a name before the call itself, in Common Lisp usually referring to
a commitment to a particular definition when there is the possibility
of a redefinition which would invalidate that commitment.  Either or
both of these optimizations may be applied to both self calls and
calls to other functions.