Make 'package' and 'import' contextual keywords

Brian Goetz brian.goetz at oracle.com
Mon Nov 28 20:05:56 UTC 2022


I would not have predicted this coming from an IDE developer, so this is quite interesting.  

Doing this with the keywords that were added in 1.2, 1.4, and 5 (assert, enum, etc) would right some historical wrongs (but you know my opinions about over-rotating towards fixing mistakes of the past.). 

And then there’s `goto`...

> On Nov 28, 2022, at 2:56 PM, Tagir Valeev <amaembo at gmail.com> wrote:
> 
> Hello!
> 
> Recent discussion about contextual keywords emerged an opposite desire for me. As we already have many contextual keywords, why not expand this to old fullfledged keywords to return some names to the identifier namespace. I can think of 'import' and 'package' which are meaningful as a keywords only at top-level of Java file. Allowing variables with such names could be desired in some programs and should not break much. At least, I occasionally want to create variables with such names. What do you think? Ok, it's just a crazy idea.
> 
> With best regards,
> Tagir Valeev 



More information about the amber-spec-observers mailing list