I noted some open issues on "Classes with Trait Composition"

Andreas Rossberg rossberg at google.com
Fri May 20 04:58:29 PDT 2011


On 19 May 2011 16:05, David Herman <dherman at mozilla.com> wrote:
> Yes, we've talked about this. One of the issues I don't know how to resolve is if we want to allow the specification of class properties aka statics, then those need *not* to be in the scope of the constructor arguments, which ends up with very strange scoping behavior:
>
>    var x = "outer"
>    class C(x) {
>        static foo = x // "outer" -- whoa!
>    }
>
> I'm not 100% up on the current thinking of the group that's been working on classes, and whether they are including statics in the design, but I think they are.

Oh, it wasn't clear to me that we really want to have static members.
I may be biased here, but I always viewed static members as just a
poor man's substitute for a proper module system. Fortunately, it
looks like we will have a real one instead!

To be honest, I'm a bit worried that there will be a _lot_ of semantic
redundancy in the end. After adding modules + classes + static members
(+ traits?), there would be at least three or four different,
complicated constructs that evaluate to some kind of object, with
significant functional overlap.

Thanks,
/Andreas


More information about the es-discuss mailing list