Could we change the syntax for when clauses?
David Alayachew
davidalayachew at gmail.com
Mon Nov 28 00:07:15 UTC 2022
Hello Amber Dev Team,
In regards to when clauses, is it possible that we could use a keyword for
when clauses that is not the "context-dependent" style keyword? And when I
say "context-dependent", I mean that the word "when" is a valid identifier,
but we are using context to be able to figure out where it should be
treated as a keyword vs. an identifier.
The reason I am requesting this is because everytime a context-dependent
keyword is added to Java, all the developers who make language/grammar
parsing tools for the Java language have to rewrite/uproot nontrivial parts
of their code to deal with several finnicky edge cases. It bogs down so
much of the parsing logic that a lot of potential optimizations or cleaner
solutions go out of the window. This leads to buggy code and/or features
not being supported. Much of that could be avoided by choosing a keyword
that is not context-dependent. I understand that there does exist a grammar
for the language, but because
Personally, I'd like it if as a language, Java never used this tactic for
any new language feature. But for now, I am only requesting that we use a
non-context-dependent phrase to signify when clauses. One suggestion would
be to use the "Hyphenated classic keyword" strategy discussed in this JEP
Draft (https://openjdk.org/jeps/8223002).
Thank you for your time and patience!
David Alayachew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20221127/8a755ec1/attachment.htm>
More information about the amber-dev
mailing list