Re: Why can’t for-of be applied to iterators?

Brian Di Palma offler at gmail.com
Tue Jun 11 13:26:30 PDT 2013


Sorry for the OT message.

On Tue, Jun 11, 2013 at 6:22 PM, Andrea Giammarchi
<andrea.giammarchi at gmail.com> wrote:
> We don't have interfaces ... I know, we could have mixins though, compatible
> with @@things too.
>

The concepts of Mixins has cropped up before in discussions and is
used in current JS code ( EventEmitter ).
I was wondering if it was possible to codify it in ES6 or is there
simply no bandwidth/time for that?

class MyClass extends MySuper mixin EventEmitter, Iterable {}

Seems the sensible way to add it to the class syntax and it means you
can still subtype and not use your one and only
code-reuse slot ( extend ) for what is a mixin.


More information about the es-discuss mailing list