Lambda vs. function
dherman at ccs.neu.edu
Fri Oct 17 15:44:27 PDT 2008
> What you appear to be saying is that wrapping the call to g()
> inside another statement indicates that it will not be tail-recursive.
No, that's not what I'm saying-- that's a given and not relevant.
What I'm trying to say is that trying to make "return" into a
tail-calling form is clunky because it makes the control behavior of
"return" different in different contexts. A tail return does
jump-then-evaluate; a non-tail return does evaluate-then-jump.
By contrast, with a lambda, there's no control effect involved in
returning. A function simply returns the result of any expression in
tail position-- no jumps in sight. No return, no jump.
More information about the Es-discuss