Finding a "safety syntax" for classes

Kevin Smith khs4473 at gmail.com
Wed Mar 21 06:35:22 PDT 2012


Hi Axel,

We should probably hold off on private and static member syntax until
there's consensus on the other open issues:

- "constructor" vs. "new" (Dave and I say "new", Allen says "constructor";
 mostly aesthetic - can be put off for now)
- class-side inheritance?  (Mark and I say no, Allen and Russell say yes)
- What restrictions for RHS of "extends"?  Must it be a constructor?
 (Russell and I say yes)

Additionally, I'm still worried about how we call the superclass
constructor:

    new() {
        // do arbitrary stuff here
        super(...);
    }

This would potentially allow a superclass instance method to be called
before the superclass initialization has completed.  If we want to maintain
the invariant (as it seems most class-based languages do) that methods can
only be called after initialization has completed, then this won't work.
 Thoughts?

kevin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120321/64301f8a/attachment-0001.html>


More information about the es-discuss mailing list