block lambda revival

Brendan Eich brendan at mozilla.com
Mon May 23 16:20:45 PDT 2011


On May 23, 2011, at 1:44 PM, Waldemar Horwat wrote:

> This seems too brittle to me.  The examples conveniently include only lambda parameters in their function calls.  Suppose you have:
> 
> a = f{|| 42}
> 
> and want to add a second lambda parameter:
> 
> a = f{|| 42}{|x| x*x}
> 
> So far so good, ignoring the little bug that || is a different token than two |'s

Yes, I know -- details, details. I'll work on it.


> (we've yet to have a coherent discussion about what really can go into these parameter lists).

I gave the grammar with semantics -- did you read it?


> Now you want to add a third integer parameter:
> 
> a = f{|| 42}{|x| x*x}(7)

You did not read the grammar. The space-separated block-lambda argument list can consist *only* of block-lambda expressions. 

http://wiki.ecmascript.org/doku.php?id=strawman:block_lambda_revival#syntax, the BlockArguments productions. Semantics in next section.

/be



More information about the es-discuss mailing list