Kevin Smith wrote:
That's exactly the reason I'm suggesting lexically bound |this| for "->" functions, because outside of "methods" (which already have shorter syntax, either via object literal extensions or classes), there doesn't appear to be a great need for function expressions with dynamic |this|.
We could indeed make -> bind |this| by fiat and take a block.

I hate the CoffeeScript deviation, though. It's just confusing for anyone who ever learned that fat-arrow binds |this| and thin-arrow doesn't.

If the use-case for block bodies with bound |this| is uncommon enough, we could just say "use a good ol' function expression long-hand." Would that be so bad, compared to the alternative you're suggesting?

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

Reply via email to