[switch] Further unification on switch
asviraspossible at gmail.com
Fri Apr 20 11:09:19 UTC 2018
On Fri, Apr 20, 2018 at 1:13 AM, John Rose <john.r.rose at oracle.com> wrote:
> I anticipate "switching" to arrows as the preferred format for all of my
> switches, except for the small minority which for some odd reason
> need the very special expressiveness that comes from fallthrough.
This proposal seems alright. But isn't it a division instead of a
The main argument against new shiny match expression was that is will
exists in parallel with old rusty switch statement.
Instead the decision was to enhance switch statement to cover use cases of
With last proposal what we get is: old rusty familiar switch
statement/expression and new shiny arrow-switch statement/expression?
I see it as the same division that we tried to avoid: two similar, but not
quite the same syntax-forms.
Why don't we get rid of arrow-syntax and continue to live in
We've been living in this world for a long time and it's not that bad here.
We can still have warnings for fall-through.
And, I think, fall-through in expression form is not that bad:
you always think about expression value, so it's hard to miss `break`
Actually I think arrow-form is really cool addition to a language
and I'm ready to switch all my switches to new arrow form (pun totally
But I feel a little disconnect with current state of affairs since
Brian has stated many times that we are not going to introduce new syntax
and deprecate old one,
but what I see is a deprecation of fall-throughy switch in favor of new
More information about the amber-spec-observers