block lambda revival
Axel Rauschmayer
axel at rauschma.de
Sat May 21 19:15:23 PDT 2011
> http://wiki.ecmascript.org/doku.php?id=strawman:block_lambda_revival
I like it. Blocks seem like “true” functions, where current functions always carry the method-ish |this| with them. Blocks are especially useful as a concise callable construct inside methods.
Questions:
- |this|: How is lexical |this| achieved? Via bind() (or something similar)?
- Can blocks be used as methods? Not as important, because conciseness for methods is taken care of by the Concise Object Literal Extensions.
- |return|: Is there a way to return from a block before it ends (like |return| does for functions)?
Thus: are blocks completely different from functions or are they translated to the same construct (internally). I can imagine this being done to make |arguments| lexical, but it seems tricky for handling lexical |this|.
Axel
--
Dr. Axel Rauschmayer
axel at rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110522/c39c2f0d/attachment-0001.html>
More information about the es-discuss
mailing list