Dynamic this

Angus Croll anguscroll at gmail.com
Mon Apr 9 12:10:51 PDT 2012


I like dynamic this.

I favor hard-bound lexical |this| for standalone function calls only. Thats
where the problems are right now

The (this, ...) syntax seems unnecessarily gnarly - better to just default
to using base ref as |this| in a method call - since by now this is
expected behavior

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?
>
> 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/9ff54df6/attachment.html>


More information about the es-discuss mailing list