in reply to =~ doesn't work with Quantum::Superpositions
#!/usr/bin/perl use Quantum::Superpositions; $\ = $/; # Create a disjunction of 'a' and 'b'. $dis = any( 'a', 'b' ); print $dis; print "=~: ",$dis =~ /\bb\b/; # true print "eq: ",$dis eq 'b'; # true
I do believe Perl 6's built in any will work with the binding operator. I also took a peak under the hood of the module itself. I could not find a binding operator listed:
q{<} => sub { qblop(swap(@_), sub { $_[0] < $_[1] })}, q{<=>} => sub { qblop(swap(@_), sub { $_[0] <=> $_[1] })}, ... all kinds of other tests q{~} => sub { $_[0]->quop(sub { ~$_[0] })},
Cheers - L~R
Update: I guess I spent too long digging around under the hood as Matt beat me to the punch.
Update 2: Chmrr reminded me that ~ is bitwise negation and that the binding operator can't be overloaded - see perldoc overload - Chmrr++
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: =~ doesn't work with Quantum::Superpositions
by theorbtwo (Prior) on Apr 20, 2003 at 18:49 UTC |