diotalevi,
I could not find a single example of the binding operator anywhere in the documentation for Quantum::Superpositions. I did however find the following code interesting:
#!/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] })},
Happy hunting!
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++ |