expression switch vs. procedural switch
john.r.rose at oracle.com
Wed Mar 14 16:06:51 UTC 2018
On Mar 14, 2018, at 8:55 AM, Kevin Bourrillion <kevinb at google.com> wrote:
> Brian reminded me in the other thread that as long as we voluntarily stick to `->` style for all cases, we get all of this. So, from my perspective, if we just adopt a style rule for Google Style that when using switch in an expression context one should stick to `->`, I might have basically what I want.
I agree it makes sense to aim for this as an "extra clean" notation,
not a separate design but a subset of the whole design.
It's a motivator for the design of multiple labels for one switch chunk
(the nice kind of fallthrough). So "case 1,2,3" syntax is a tweak for
"case 1: case 2: case 3", allowing either colon or arrow after the
third case label.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the amber-spec-experts