develooper Front page | perl.perl6.language | Postings from June 2009

Re: XOR does not work that way.

Thread Previous | Thread Next
From:
Jon Lang
Date:
June 22, 2009 19:11
Subject:
Re: XOR does not work that way.
Message ID:
ef30550b0906221911i62d7e6ceqeb81e12147e9adf4@mail.gmail.com
Take a look at the page to which Damian provided a link.  You'll find
that XOR does indeed correspond to the definition being used by Perl
6, as well as the natural language meaning.  What other languages call
XOR is actually an "odd parity check".

As I suggested above, I think that Perl 6 already addresses both of
these: use '^' or 'xor' (or 'one()') if you want XOR semantics; use
'?^' if you want "odd parity" semantics.

> I suggest that to aid learnability, Perl 6 has the same semantics for 'xor'
> as other languages with that operator, unless there is a good explicit
> reason to do differently; that is, don't do differently just for the heck of
> it.

We never do things differently for the heck of it.

-- 
Jonathan "Dataweaver" Lang

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About