Dynamic this

John J Barton johnjbarton at johnjbarton.com
Mon Apr 9 11:11:41 PDT 2012


On Mon, Apr 9, 2012 at 10:46 AM, Herby Vojčík <herby at mailbox.sk> wrote:

> Hello,
>
> this is more a conceptual question post. But first some proposals that
> circulated in the list:
>
> 1. Dynamic-this enabled fat arrow functions.
>
> (this, ...) => expr
> (this, ...) => { body }
>
> 2. ABC (apply/bind/call) shortcuts.
>
> thisobj::identifier(...args) // apply
> thisobj::identifier // bind
> thisobj::identifier(arg, arg, ...) // call
>
> Now, I like them both. I like this dynamic this being in the language and
> things that it allows (ad-hoc methods). Sure it can be used wrong ways, as
> everything.
>
> The question is: is dynamic this liked (in the sense, is it the feature
> which we see as valuable and as one we want proudly have in the language)
> or is there rather the footgun/no-one-uses-it-right movement for
> diminishing its role to strange relic?
>

Or 3. Add this feature after we have experience with => use models. (I
assume nothing in => prevents its later adoption; existing function() works
in the meantime).

Just like max/min classes, we should avoid any complications that slow
lexical 'this'. Once lexical this lands, then add complications.

The most effective way to grow ES is shorter faster feature cycles.

jjb


>
> I saw the mixed opinions.
>
> Herby
> ______________________________**_________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/**listinfo/es-discuss<https://mail.mozilla.org/listinfo/es-discuss>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120409/ca9ed332/attachment-0001.html>


More information about the es-discuss mailing list