Inner functions and outer 'this' (Re: That hash symbol)

P T Withington ptw at pobox.com
Tue Mar 29 06:47:49 PDT 2011


On 2011-03-29, at 08:52, Sam Tobin-Hochstadt wrote:

> I agree entirely that it goes with the existing fixed implicit |this|
> binding -- I just think that cuts the other way.  The reason we're
> having this discussion is that the existing behavior of |this| isn't
> always what you want, and is hard to get around because of its fixed
> and implicit nature.  I think we should alleviate *that* problem, not
> just the worst symptom.

Way back in

https://mail.mozilla.org/pipermail/es-discuss/2008-August/007273.html

I raised the `this` problem:  When you write a function you can choose the names of all your parameters (for maximum legibility of your code) except the implicit one, where you are forced to accept the name `this`.  If you could specify a different name, specifying which implicit binding you meant in the presence of multiples would be simplified.

I won't propose a syntax for specifying an alternative name for `this`, for fear of being taken out to the (bike)shed and getting caned, but I do think it worth considering:  why must that implicit parameter have a fixed name?




More information about the es-discuss mailing list