break seen as a C archaism

Guy Steele guy.steele at oracle.com
Thu Mar 15 19:36:13 UTC 2018


> On Mar 15, 2018, at 3:48 PM, Remi Forax <forax at univ-mlv.fr> wrote:
> 
> ----- Mail original -----
>> De: "mark" <mark at io7m.com>
>> À: "amber-spec-experts" <amber-spec-experts at openjdk.java.net>
>> Envoyé: Jeudi 15 Mars 2018 20:06:40
>> Objet: Re: break seen as a C archaism
> 
>> On 2018-03-15T14:50:45 -0400
>> Brian Goetz <brian.goetz at oracle.com> wrote:
>>> 
>>>> If you are reconsidering options, reconsider "yield", meaning
>>>>   "break current context with this value".
>>> 
>>> Still feeling a little burned by first time we floated this, but willing
>>> to try another run up the flagpole....
>> 
>> Silly idea, but... *puts on fireproof suit*:
>> 
>> "finally x;"
> 
> I believe we can also use any new keywords given that you can not have an identifier followed by an identifier in Java.
> 
> by example
>  pass x;
>  quit x;
>  end x;

Remember that in this situation (switch expressions), `x` can be any expression, not just an identifier.

So “pass x;” cannot be confused with existing syntax, but “pass (x)” can be (looks like a method call).

—Guy



More information about the amber-spec-experts mailing list