new instantiation design alternatives

Brendan Eich brendan at mozilla.org
Thu Sep 11 15:33:42 PDT 2014


Allen Wirfs-Brock wrote:
> "new?" would be fine,.  Actually better.  But we shied away from it, so as to not impinge upon future use of "?".  Even if there was no lexical ambiguity there might be conceptual confusion with some future usage.

When last we considered refutable patterns, e.g., match (e) { case {x, 
y, ?z}: /* x and y, maybe z */ }, the ? came in front and was in the 
pattern language -- a new and different sub-grammar.

What other possible future ? uses were there?

> But, if there is a general willingness to to use "?", I'd be all for it.
>
> BTW, "new^" (other whatever) is intended to be a single token, not a pair of tokens.

+1 to 1 token.

/be


More information about the es-discuss mailing list