On May 31, 2012, at 11:13 AM, Russell Leggett wrote:

> If you reframe the problem as |this| just being another parameter, this whole 
> debate seems quite silly to me. Any function that is written to have a |this| 
> value be dynamic, and possibly set by the caller can be rewritten as a 
> function that does not use |this| and simply has an extra parameter. Framing 
> it this way, asking for an isBound method is no more useful than having a 
> method isParamUsed(n) which checks if the nth parameter is used in the 
> function body.

+1

> I think it would lead to brittle code to try to ask the function if it uses 
> |this| as some means of overloading/duck typing. That is too much 
> introspection into the implementation.

Beautifully put, thank you. The idea of trying to provide API's that try to 
infer complicated, uncomputable contracts about the intended use of a function 
is a fool's errand.

Dave

_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to