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

Brendan Eich brendan at mozilla.com
Tue Jun 11 17:33:28 PDT 2013


Brian Di Palma wrote:
> 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 {}
What would this syntax do that couldn't be done better by libraries? 
Remember that extends' RHS is an expression.

/be

>
> 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.
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>


More information about the es-discuss mailing list