Yield as contextual keyword (was: Call for bikeshed -- break replacement in expression switch)

John Rose john.r.rose at oracle.com
Mon May 20 17:02:52 UTC 2019

On May 20, 2019, at 9:06 AM, Guy Steele <guy.steele at oracle.com> wrote:
> under this theory a plausible spelling of `break-with` is `break:`

FWIW I'd be very very happy with the look/feel of `break: x;`.

I'd be a little happier with `break->x` because I'm used
to reading expressions `x` in `->x` but not so much `:x`.
Though there is `p?y:x`, for that matter.

Dan, I hear you about block-switches having `:` instead
of `->`.  I guess that's a bit of support for Guy's proposal,
then.  I still think `->` will be a bit more readable, though
I may be falling for the "make new syntax STaNd *oUT*"

I've always thought `break` serviceable for the purpose
we are discussing, and even applicable to new statement
types, especially if strengthened with a label, as you point
out, Guy.  I'm very happy to go back to `break`.

— John

More information about the amber-spec-experts mailing list