Hrm, that's kinda unfortunate. A C-style switch is always a tradeoff, flexibility wise, but the tradeoff can be big if you have a large number of cases. I supose if we're lucky, perl6 will optimize switches that use constant expressions into a jump table, though I suspect such a feature wouldn't be out in the first version of perl6--time enough for optimizations later.
----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer
:(){ :|:&};:
Note: All code is untested, unless otherwise stated
In reply to Re: Re: Re: Re: Re: Perl Idioms Explained: && and || "Short Circuit" operators
by hardburn
in thread Perl Idioms Explained - && and || "Short Circuit" operators
by davido
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |