Bound instance-function vending (was RE: Arrow binding)

Aymeric Vitte vitteaymeric at gmail.com
Sun Apr 29 10:41:21 PDT 2012


1- Yes, several time that you mention it, and ++ from me each time

2- I prefer the dot notation rather than Object.extend, even if both are 
good

Le 28/04/2012 20:49, Kevin Smith a écrit :
> Hi Angus!
>
>     1) Kevin et al suggested YAGN call/apply on (non-method)
>     functions. Here's a pretty neat example where call/apply is a
>     perfect fit for standalone functions - and would break if replaced
>     with fat arrows.
>
>     https://gist.github.com/2520731
>
>
> This is a great example.  Two points:
>
> 1.)  In this case, I think it's going to be pretty difficult to prove 
> that a "dynamic this" arrow function would be any more readable or 
> "better" than current syntax:
>
>     // On what basis is this:
>     this.initialize = () -> { ... };
>
>     // any better than this?
>     this.initialize = function() { ... };
>
> There are a couple of characters saved, but it's less readable.  Why 
> introduce new syntax for such dubious gain?
>
> 2.) For mixin stuff like your example, I think the elegant solution is 
> "object literal extension" syntax:
>
> https://gist.github.com/2521128
>
> I'm not sure of the status of that syntax, but hopefully it will get 
> included in ES6.
>
> kevin
>
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss

-- 
jCore
Email :  avitte at jcore.fr
Web :    www.jcore.fr
Webble : www.webble.it
Extract Widget Mobile : www.extractwidget.com
BlimpMe! : www.blimpme.com

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


More information about the es-discuss mailing list