3 ms·
"I honestly don't see how in a C-style language, using different names for the exact same construct found in every other C-style language adds any real value."
by philwelch 18y ago
"I honestly don't see how in a C-style language, using different names for the exact same construct found in every other C-style language adds any real value."
Did you notice the next line?
"<japhb> sjohnson: and it's quite powerful."
That implies it's more than just switch/case. If it's not quite the same thing as switch/case, then it's appropriate to give it a different name, even if it fills the same functional role.
- draegtun 18y agoAnd given/when is already part of Perl5 http://perldoc.perl.org/perlsyn.html#Switch-statements http://perldoc.perl.org/perlsyn.html#Switch-statements
- trezor 18y agoThanks for the reference. I quickly skimmed it, and as far as I can tell the only thing it offers compared to a traditional switch/case statement, is the evaluation of expressions, as opposed to just accepting constants. I can see the rationale behind using a different name for the construct, but I still think it would have made more sense to stick to switch/case.
- draegtun 18y agoLarry Wall also changed it to given/when partly for linguistic reasons. See here for his full explanation: http://dev.perl.org/perl6/doc/design/apo/A04.html http://dev.perl.org/perl6/doc/design/apo/A04.html (see RFC 022).