> Fixed: 
> http://wiki.ecmascript.org/doku.php?id=strawman:block_lambda_revival&do=diff
> 
> The LeftHandSideExpression productions and their kids (NewExpression and 
> CallExpression) are funky and I keep misremembering how NewExpression is what 
> bottoms out via MemberExpression -> PrimaryExpression at Identifier.


If I read the grammar correctly, then you can do things such as (read "~~~>" as 
"desugars to"):

     myfunc {|| } {|| } (arg3) (arg4)  ~~~>  myfunc({|| }, {|| }, arg3, arg4)

The above is a function call with 4 arguments. My wish would be different: I 
would want to put lambdas after a function or method call and treat those 
lambdas as additional arguments:

     myfunc(arg1, arg2) {|| } {|| }  ~~~>  myfunc(arg1, arg2, {|| }, {|| })
     myfunc {|| } {|| }  ~~~>  myfunc({|| }, {|| })

Rationale: I would always make lambdas trailing arguments, similar to
     if (cond) {} {}
And I would rather achieve this effect without currying. Following a block with 
a non-block doesn’t seem like a good idea.

Has the other approach been considered?

-- 
Dr. Axel Rauschmayer
[email protected]

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com

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

Reply via email to