On May 23, 2011, at 6:29 PM, Brendan Eich wrote:

> On May 23, 2011, at 6:27 PM, Waldemar Horwat wrote:
> 
>> On 05/23/11 18:09, Brendan Eich wrote:
>>> Here are some ideas:
>>> 
>>> 1. Extend the current proposal to allow parenthesized expressions 
>>> interleaved with no line terminators, only optional horizontal space 
>>> characters, with block-lambda expressions:
>>> 
>>> bar = foo {|x| x * x} (42);
>> 
>> That might work, with the key part being "interleaved".  We need to keep the 
>> semantics of
>> 
>> bar = foo(42)(33);
>> 
>> the same as now.
> 
> Absolutely.
> 
> I'll make an attempt, since option 0 (see later mail) is both easy and a bit 
> of a hasty surrender.

Done, at http://wiki.ecmascript.org/doku.php?id=strawman:block_lambda_revival 
-- this was easy, but it made me wonder whether parentheses for the plain 
Expression arguments that may occur after the leading BlockLambda ought not 
better be curly braces. IOW, instead of

  bar = foo {|x| x * x} (42);

support this:

  bar = foo {|x| x * x} {42};

This is more uniform on its own new terms. If the first actual parameter wants 
to be an expression, the programmer must parenthesize the entire argument list 
(comma separated of course), or else write {| | 42} as the first argument.

So, are curlies better than parens in this situation? I think it is a bit of a 
corner case, but good to address to avoid the currying hazard.

/be

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to