Re:Perl 6's given: switch on steroids
by toast0 on Sunday June 02, 2019 @11:30AM
(#20076066)
We should not optimize for the common case at the expense of making the uncommon case impossible.
With C style switch, you can fall through or break. In languages that don't provide fall through (say Erlang's case expression), if you have something that fits fall through, you need to either duplicate the inner code, or have a more verbose construction with multiple phases of matching.
With C style switch, you can fall through or break. In languages that don't provide fall through (say Erlang's case expression), if you have something that fits fall through, you need to either duplicate the inner code, or have a more verbose construction with multiple phases of matching.