3 ms·
And given/when is already part of Perl5 http://perldoc.perl.org/perlsyn.html#Switch-statements http://perldoc.perl.org/perlsyn.html#Switch-statements
by draegtun 17y ago
And given/when is already part of Perl5 http://perldoc.perl.org/perlsyn.html#Switch-statements http://perldoc.perl.org/perlsyn.html#Switch-statements
- trezor 17y 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 17y 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).