new instantiation design alternatives

Andreas Rossberg rossberg at google.com
Mon Sep 15 06:10:39 PDT 2014


On 15 September 2014 06:24, Brendan Eich <brendan at mozilla.org> wrote:
> In the C++ family (Andreas is right, there's a history and lineage to
> consider), the special head form may require you to keep it simple and put
> any such conditioning in the base class, or an intermediary. This doesn't
> bite back much.

Well, regarding this particular aspect, the wider curly braces family
doesn't have a consistent opinion. Our current design is following
Java more closely than C++, which I think is fine (modulo dubious
defaults). C++ needed the special syntax primarily because of its
rather crazy initialization vs assignment story.

If we were to go with a C++ like solution, we should refrain from
abusing colon, though. It should be "constructor(x) extends super(x+1)
{}". Want to safe the colon for type annotations. :)

/Andreas


More information about the es-discuss mailing list