Basic Lambdas and Explicit Tail Calls Repackaged

Michael Day mikeday at
Mon Dec 8 00:38:10 PST 2008

Hi Brendan,

> I would be surprised if we ever evolved a version that lost the default 
> this binding whereby
> var o = {m: function(){print(this.x);}, x: 42};
> o.m();

Right, but if it was a lambda instead:

var o = {m: lambda(){print(this.x);}, x: 42};

the options are:

  - Capture the 'this' value in scope when the lambda is defined, and 
use that when the lambda is called.

  - Always return 'undefined' when 'this' is evaluated within a lambda.

  - Any others?

Do either of these policies make lambdas useful language constructs as 
compared with normal functions?


Print XML with Prince!

More information about the Es-discuss mailing list