Perl6's ^^
Perl6's ^^
Posted Feb 17, 2015 23:34 UTC (Tue) by HelloWorld (guest, #56129)In reply to: Perl6's ^^ by marcH
Parent article: Scalar typing in the PHP world
Posted Feb 18, 2015 0:28 UTC (Wed)
by rgmoore (✭ supporter ✭, #75)
[Link]
Actually, it looks as if that doesn't make it inconsistent, because Perl 6 has done away with the built-in bitwise operators. Now, &, |, and ^ produce Junctions with different properties. And Junctions, made by joining with &, return true on a test only if all items in the Junction return true for the test, Or Junctions, made by joining with |, return true if any item returns true, and One Junctions, made by joining with ^, return true if exactly one item returns true. So ^^ returning true if exactly one item is true is consistent with ^, just not with the way ^ and xor worked under earlier versions of Perl.
Perl6's ^^