Mark J. Reed wrote:
All of which is just by way of agreeing with Jon: formal logic is not
the primary motivator behind Perl's design. So while it should be
considered, it's not a knockout punch to say "but logic doesn't work
that way."

I think another thing to consider is a survey of the various other common languages and see what semantics they have with an expression like this pseudocode:

  true xor true xor true

I would like to know in what languages the above expression is false ... or 
true.

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.

I submit that Perl 5 appears to result in true, as tested with:

  perl -e "print (5 xor 2 xor 3)"

... which returns 1, indicating also that Perl 5 xor doesn't short-circuit.

Regardless of the above, I think Perl 6 should have both operators, testing exactly 1 or an odd number.

-- Darren Duncan

Reply via email to