The new operator

Axel Rauschmayer axel at
Sat May 12 17:08:13 PDT 2012

Until, I’ve stuck to the simple rule: Always use `new` when you want to create an instance. That avoids confusion when it comes to functions such as String and Boolean: I like using them to coerce values.

Given that value object constructors such as uint64 are currently invoked without `new`, I’m wondering whether that rule changes:

- Do we still need `new`? If we had class declarations, their desugared versions could easily always create new instances, whether invoked via `new` or as a function. The same holds for object exemplars: Calling such an exemplar could “instantiate” it.

- Should there be alternate, possibly less confusing, ways of coercing values? ToPrimitive() would certainly be nice to have.


Dr. Axel Rauschmayer
axel at


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list