Arrow binding

Axel Rauschmayer axel at rauschma.de
Tue Apr 24 15:30:59 PDT 2012


> B. add expression bodies to method shorthands, don't add skinny arrow
> 
>     (-) Loses the flexibility of shorthand syntax for assigning to an existing object, a Tab pointed out. (Sorry Axel, mustache is not particularly Harmonious.)

Sorry to hear that. _.extend(), then (by whichever name)? As long as this operation can be performed in some manner...

>     (+) Keeps us to just one arrow form
> 
> C. eliminate method shorthands, add skinny arrow
> 
>     (-) Loses the method shorthand in object literals
>     (-) Methods in classes would remain the same, which loses some symmetry between object literals and classes
>     (+) Eliminates visual confusion between getters/setters and method shorthand, but still with a minimal syntax (i.e., "->")

That would make super-references more difficult to implement, right? You’d have to invoke a defineMethod() somewhere along the way.

-- 
Dr. Axel Rauschmayer
axel at rauschma.de

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120425/ab11c2ac/attachment-0001.html>


More information about the es-discuss mailing list