Scoped binding of a method to an object

Russell Leggett russell.leggett at
Mon Oct 14 12:51:44 PDT 2013

I get that this isn't really the same, but I think one really viable
solution for the scoped method problem (which is really just the expression
problem, right?) is the proposed bind operator

It doesn't use dots, so it won't mask the difference between the normal
prototype chain with some additional scoped binding (for good or ill), but
along with it comes the clarity and comfort of lexical binding and also the
potential use of the module system.

    import {shuffle,each,filter} from "underscore2";


And if that isn't enough because you need more polymorphic behavior, I
think something like Clojure's protocols
<>could be implemented as a library to be
used in conjunction.

- Russ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list