On Mon, Aug 11, 2014 at 6:33 PM, Domenic Denicola
<domenic at domenicdenicola.com> wrote:
> When I last looked at this, it seemed like a perfect use case for [Traits](http://soft.vub.ac.be/~tvcutsem/traitsjs/tutorial.html). A "Set-like" trait would require definitions for add, delete, and [Symbol.iterator], but provide has, forEach, entries, keys, values, clear, and size, plus any future interfaces.
>
> Then you would implement such set-likes by mixing in the set-like trait into your prototype, which contains type-restricted definitions for add, delete, and [Symbol.iterator] (plus probably some of the other methods for performance reasons).
>
> Presumably a future version of ES that contains traits would define set-like, map-like, and other traits that could be used.
Yes, something Trait-like would be sufficient.
~TJ
domenic at domenicdenicola.com (2014-08-18T18:35:41.534Z)