|
|
Subscribe / Log in / New account

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

Which kinda makes it inconsistent, doesn't it? So my point stands.


to post comments

Perl6's ^^

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.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds