Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: Secret Perl Operators: the boolean list squash operator, x!!

by Aristotle (Chancellor)
on Jul 31, 2006 at 18:35 UTC ( #564834=note: print w/ replies, xml ) Need Help??


in reply to Re: Secret Perl Operators: the boolean list squash operator, x!!
in thread Secret Perl Operators: the boolean list squash operator, x!!

I think that will be more intelligible to those who arenít familiar with the idiom.

I donít know. Shouldnít that mean it should be written with one more space, x ! !? I think the hard-to-grasp part is actually why/how () x $boolean works; the addition of !! doesnít make it appreciably more difficult to understand, in my opinion.

Makeshifts last the longest.


Comment on Re^2: Secret Perl Operators: the boolean list squash operator, x!!
Re^3: Secret Perl Operators: the boolean list squash operator, x!!
by xdg (Monsignor) on Jul 31, 2006 at 19:42 UTC

    Because !! is a (moderately known) idiom as well (the "boolification" operator), I don't think that needs to be split up. My snap reaction to seeing ('foo') x!! $bar is a "huh?" until my brain parses x!! into two separate things. My snap reaction to ('foo') x !!$bar is immediately "list repeated boolean times".

    Separately, I was thinking of parallels to "boolification" for a name, but it's not true or false -- it's a "there or not there" operator. That made me think first of the Cheshire Cat fading in and out, and the cat idea reminded me of Schrodinger's Cat and other quantum mechanical metaphors. Maybe there's a good name in there somewhere.

    -xdg

    Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (10)
As of 2014-07-13 19:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (251 votes), past polls