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

P T Withington ptw at pobox.com
Tue Mar 29 13:12:45 PDT 2011


On 2011-03-29, at 14:19, Allen Wirfs-Brock wrote:

> I'll leave it to reader to weigh the above pros and cons.  But I do have a closing statement:
> 
> There is a decades long disagreement among designers/users of function and object-oriented languages.  OO proponents think there is something special about the "receiver" of a method call and that "self-calls" have special significance.

If I had a vote, it would be for a way to explicitly name the `-1th` argument to a function.  And I would wish for it to be available in all function forms, defaulting to using the legacy name `this`, if not otherwise specified.  I believe it not only addresses the issue in this thread, but leaves the way open for generic functions.

[As a user, I infer I fall into your "functional proponent" camp, but I claim to also be an o-o proponent.  I just find it much easier to think in generic functions and consider the "distinguished receiver" of message passing as being a degenerate case of that, which has a layer of syntactic sugar to let you express foo(a, b, c) as a.foo(b, c), if you like to think the other way.]


More information about the es-discuss mailing list