Re: Traits/Mixins for class syntax

2013-05-20 Thread Dmitry Soshnikov
On May 20, 2013, at 2:42 PM, Allen Wirfs-Brock wrote: > > On May 16, 2013, at 5:11 PM, Dmitry Soshnikov wrote: > >> Hey guys, >> >> Sorry for the random question (probably it was already discussed). >> >> What is a current state having mixins/traits syntax along with a class >> definition? >

Re: Traits/Mixins for class syntax

2013-05-20 Thread Allen Wirfs-Brock
On May 16, 2013, at 5:11 PM, Dmitry Soshnikov wrote: > Hey guys, > > Sorry for the random question (probably it was already discussed). > > What is a current state having mixins/traits syntax along with a class > definition? They aren't part of ES6. There have been past discussions about mix

Re: Traits/Mixins for class syntax

2013-05-19 Thread Dmitry Soshnikov
Sure, this abstraction presents in almost any library related with classes sugar. I'm just curious whether it was even discussed here, and what is probability it can be included into this spec. (Or maybe into ES7, no matter much yet; I still excluding the version that I'm asking a "stupid question

Re: Traits/Mixins for class syntax

2013-05-17 Thread Andrea Giammarchi
for what it matters, redefine.js already does exactly that. ( https://github.com/WebReflection/redefine#classes ) var Foo = redefine.Class({ extend: Bar, mixin: [F, object, F2.prototype, Class3] }); and yes, it makes perfect sense, specially for mixins such EventEmitter and similar my 2 cent

Re: Traits/Mixins for class syntax

2013-05-16 Thread Dmitry Soshnikov
On Thu, May 16, 2013 at 2:11 PM, Dmitry Soshnikov < dmitry.soshni...@gmail.com> wrote: > Hey guys, > > And sorry for auto greeting mailing-template if it hurts someone ;) > Sorry for the random question (probably it was already discussed). > > What is a current state having mixins/traits syntax

Re: Traits/Mixins for class syntax

2013-05-16 Thread Dmitry Soshnikov
In the simplest way can just desugar to Object.mixin(Foo.prototype, Mixin1[, Mixin2, .., MixinN); before the class creation (methods of own class's prototype should override mixins, but not the parent methods). Although, form I see in the latest draft even Object.mixin(...) is still under discussio

Traits/Mixins for class syntax

2013-05-16 Thread Dmitry Soshnikov
Hey guys, Sorry for the random question (probably it was already discussed). What is a current state having mixins/traits syntax along with a class definition? Like: class Foo extends Bar { use EventEmitter, CommonMethodsMixin; ... } where mixins provided in "use" declarations are simple o