Block lambda grammar: BlockArguments

Brendan Eich brendan at mozilla.org
Thu Jan 12 23:43:10 PST 2012


> Brendan Eich <mailto:brendan at mozilla.org>
> January 12, 2012 11:39 PM
>   v.map {|e| e*e}

Er, not even that -- Arguments required in a CallExpression, so v().map 
or v.map() but not just v.map. Fixes coming tomorrow.

/be
>
> or
>
>   get_map() {|e| e*e}
>
> or similar. I will fix.
>
> /be
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
> Axel Rauschmayer <mailto:axel at rauschma.de>
> January 12, 2012 11:16 PM
> http://wiki.ecmascript.org/doku.php?id=strawman:block_lambda_revival
>
> I’m trying to understand the syntax:
> BlockArguments :
> BlockLambda
> BlockArguments [no LineTerminator here] BlockLambda
> BlockArguments [no LineTerminator here] ( InitialValue )
>
> - Wouldn’t this allow the following? BlockLambda [no LineTerminator 
> here] BlockLambda
> - InitialValue means that paren-free can be combined with arguments 
> that aren’t blocks, right?
>
> myLoopFunc(initValue1)(initValue2) { | arg1, arg2 | ... }
>
> I think I would prefer the following (IIRC, more like Ruby):
>
> myLoopFunc(initValue1, initValue2) { | arg1, arg2 | ... }
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120112/8845f4df/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: postbox-contact.jpg
Type: image/jpeg
Size: 1290 bytes
Desc: not available
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120112/8845f4df/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: postbox-contact.jpg
Type: image/jpeg
Size: 1222 bytes
Desc: not available
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120112/8845f4df/attachment-0001.jpg>


More information about the es-discuss mailing list