proper tail calls

Jon Zeppieri jaz at bu.edu
Mon Jan 21 10:44:54 PST 2008


On 1/21/08, Jon Zeppieri <jaz at bu.edu> wrote:
> On 1/21/08, Igor Bukanov <igor at mir2.org> wrote:
> >
> > let f2;
> >
> > function f(a)
> > {
> >     f2 = function() { return a; }
> >     goto return g();
> > }
> >
> > function g() {f2 = null; ... }

To clarify,  space is consumed by the evaluation of:

   f2 = function() { return a; }

...which constructs (and binds) a closure.

   goto return g();

...on the other hand, does not consume space.  a is still live, but
it's live as part of f2's closure, not as part of f's activation
frame.



More information about the Es4-discuss mailing list