Use case: error checks. For example: forEach could complain if it got both an 
arrow function and a thisValue. One could also complain if one expected a 
function with dynamic/unbound `this` and got a function with bound `this`, 
instead. To be extra strict, one could even complain when an unbound function 
is provided where a non-method function is expected (because either an arrow 
function should be used or a method’s `this` should be bound). All of these are 
things that you do as an API implementer, not necessarily as an API user.

Static checking would be even better, but then we would need a way to declare 
whether an argument is expected to have dynamic or lexical this.

Possibly 

On Apr 29, 2012, at 20:01 , Brendan Eich wrote:

> If so then there is no need for any isArrowFunction or 
> isFunctionThatBindsOrIgnoresThis predicate.
> 
> /be
> 
> Axel Rauschmayer wrote:
>> With “rules”, I don’t mean rules in the sense of the language spec, but 
>> rather rules for teaching the language to newcomers.
> 

-- 
Dr. Axel Rauschmayer
[email protected]

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to