Scoped binding of a method to an object

Brendan Eich brendan at mozilla.com
Mon Oct 14 08:42:35 PDT 2013


Andreas Rossberg wrote:
> My take-away was that scoped extension methods are only bearable in a
> language with a static, nominal class system (like C#), where the
> additional lookup dimension can be resolved at compile time.

Right.

The http://scg.unibe.ch/archive/papers/Berg03aClassboxes.pdf work, which 
inspired Ruby refinements as well as the scoped object extensions 
strawman, is about Smalltalk. For all its dynamic typing, Smalltalk has 
nominal class types and static method membership judgements.

Based on the research, it seems to me that if we want this in JS, we 
should look at how to build it on ES6 classes + modules.

/be


More information about the es-discuss mailing list