On top of which, Damian has expressed an interest in ! for a
superpositional xor.
Which would behave how, exactly?
Well, that's still a matter for conjecture.
N-ary xor isn't particularly useful, because binary xor naturally generalizes
to: "an odd number of these N operands are true". (Hint: think about the
truth table for logical C<$a !! $b !! $c>).
An alternate interpretation of generalized xor is that it means
"exactly one of these N operands is true". That's what I envisage
superpositional C<!> doing:
Function Operator
any |
all &
one !
So you could write:
if $x1 ! $x2 ! $x3 == 0 {
print "Cubic equation has a unique root\n";
}
or:
$nonrepeated = any(@value) == one(@value);
or:
$second_biggest = any(@value) < one(@value);
None of these makes C<one>/C<!> as essential as C<any> or C<all>, but:
(a) someone smarter than me will almost certainly
find a killer app for C<one>,
(b) the symmetry of:
Logical: && || !!
Bitwise: .& .| .!
Superpositional: & | !
is important...mnemonically, DWIMically, and aesthetically.
Damian