Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Re: Re: Re: Re: Perl Idioms Explained: && and || "Short Circuit" operators

by hardburn (Abbot)
on Oct 23, 2003 at 16:28 UTC ( #301631=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: Re: Re: Perl Idioms Explained: && and || "Short Circuit" operators
in thread Perl Idioms Explained - && and || "Short Circuit" operators

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


Comment on Re: Re: Re: Re: Re: Perl Idioms Explained: && and || "Short Circuit" operators
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://301631]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (17)
As of 2015-07-28 19:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (258 votes), past polls