block lambda revival

Axel Rauschmayer axel at
Sat May 21 19:15:23 PDT 2011


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.


- |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|.


Dr. Axel Rauschmayer

axel at


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list