On Thu, May 31, 2012 at 4:44 PM, Allen Wirfs-Brock <[email protected]>wrote:

>
> I don't think I argued that for isBound although I certainly would make
> that argument about arrow functions in general.
>
> In this case, I'm assuming a debugging scenario. Somebody is passing arrow
> functions through an API whose contract requires a callback function that
> is invokable with a dynamic this.  I'm trying to find the culprit.  So I
> write a function like the above to try to catch it.  Or I just put a
> isBound check in the API function.
>
> It's true, that an offending function might be one that was written with a
> dynamic this binding but which never actually references this. That is also
> probably a violation of my contract. So, I may get false negative.  But
> there is still a good change that finding positives will solve my debugging
> problem.
>

Thanks for the clarification; I'm not sure I would have guessed that from
this code.

For the purpose you state, given two isBoundOrWhateverItIsNamed functions f
and g where,

* neither has any false positives,
* both obey simple deterministic rules that are easy to understand,
* f has strictly fewer false negatives than g.

Which should you prefer for the purpose of your code?


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

Reply via email to