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

Kevin Smith khs4473 at
Sat Apr 28 11:49:44 PDT 2012

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.

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:

I'm not sure of the status of that syntax, but hopefully it will get
included in ES6.

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

More information about the es-discuss mailing list