Finding a "safety syntax" for classes

Rick Waldron waldron.rick at gmail.com
Wed Mar 21 14:59:32 PDT 2012


>
> [snip]
> There are likely issue with the above syntax.  However, I can imagine
> someway saying:
>
> class Foo extends mixin(MyBase, enumerable) {
> }
>
> where mixin is defined as:
>
> function mixin(directSuper, ...mixins) {
>     let effectiveSuper = class extends directSuper{ constructor(...args)
> {return super.constructor(...args)}};
>     for (let m of mixins) Object.extend(effectiveSuper.proto,mixins);
>  //probably need some conflict resolution logic
>     return effectiveSuper
> }
>
>
Allen, this is very exciting, thank you for point out the possibility. I'm
going to try to work this into some of the support cases I've been writing.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120321/d206c534/attachment.html>


More information about the es-discuss mailing list