break seen as a C archaism
Brian Goetz
brian.goetz at oracle.com
Thu Mar 15 22:38:38 UTC 2018
At this point, the Colonel from Monty Python breaks in, and shuts us
down for being too silly....
On 3/15/2018 6:37 PM, Remi Forax wrote:
>
>
> ------------------------------------------------------------------------
>
> *De: *"John Rose" <john.r.rose at oracle.com>
> *À: *"Guy Steele" <guy.steele at oracle.com>
> *Cc: *"amber-spec-experts" <amber-spec-experts at openjdk.java.net>
> *Envoyé: *Jeudi 15 Mars 2018 23:06:51
> *Objet: *Re: break seen as a C archaism
>
> On Mar 15, 2018, at 2:44 PM, Guy Steele <guy.steele at oracle.com
> <mailto:guy.steele at oracle.com>> wrote:
>
>
> break return x;
>
> Then everybody is happy:
> (1) Cannot be confused with the old `break` syntax.
> (2) Clearly exits a `switch` like `break` does.
> (3) Clearly returns a value like `return` does.
> (4) Better encourages exclusive use of `->` (because using
> `->` rather than `: break return` saves even more characters
> than using `->` rather than `: break`).
> (5) In the year 2364, this can be further generalized to allow
> `continue return x;`.
> (6) Those who want new language features to really jump out
> will surely be satisfied.
>
>
> Not bad. It also doesn't weaken "plain return" in the
> way I was worried about.
>
> I would have numbered that last point (-1), though.
>
> — John
>
>
> i think, we're missing a 'do' just to be sure,
> do break return x;
>
> Rémi
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/amber-spec-experts/attachments/20180315/75b61156/attachment.html>
More information about the amber-spec-experts
mailing list