Draft JEP: Keyword Management for the Java Language

John Rose john.r.rose at oracle.com
Wed May 1 19:46:46 UTC 2019


On May 1, 2019, at 5:07 AM, Remi Forax <forax at univ-mlv.fr> wrote:
> 
> the current rule doesn't work well if in the future we want to introduce operator overloading.

This sort of thing is unavoidable in language evolution, isn't it?
Any future extension will have to avoid ground already taken
by past extensions.

If we reserve the space of hyphenated keywords this year,
and introduce new kinds of expressions involving hyphen
next year, it follows that code written next year must avoid
accidentally mentioning hyphenated keywords.

Luckily that's pretty easy:  Just put one or more whitespace
characters near the hyphen, so that it can be a minus sign
(or whatever other job our future selves dream up for it).

One nice thing about Alex's proposal is that, if adopted this
year, IDEs can immediately syntax-color all possible hyphenated
proper keywords (and maybe even most of the conditional ones).

Linguists call this sort of scheme "generative", in that you can
coin new words, within the scheme, and their usage is somewhat
clear even if they have never been seen before.  Example from
English (from Greek):  "Xgenic" describes a source of some X, so
although the term "lexigenic" is not in common use, but you
probably guess a meaning for it, some kind of source of "lex".
This particular term might serve to describe a lexical rule that
generates new lexemes, such as Alex's lexigenic proposal.

— John


More information about the jdk-dev mailing list