Re: XOR does not work that way.

2009-06-22 Thread Jon Lang
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

Re: XOR does not work that way.

2009-06-22 Thread Darren Duncan
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 variou

Re: XOR does not work that way.

2009-06-22 Thread Mark J. Reed
> On Mon, Jun 22, 2009 at 4:12 PM, Minimiscience wrote: > I don't think natural language -- especially the abomination that is English > -- is the best guide for understanding logical operations (why, yes, I *do* > speak Lojban; how did you know?). To which Jon Lang replied: > You're aware that Pe

Re: XOR does not work that way.

2009-06-22 Thread Jon Lang
On Mon, Jun 22, 2009 at 4:12 PM, Minimiscience wrote: > On Jun 22, 2009, at 5:51 PM, Damian Conway wrote: >> >> Perl 6's approach to xor is consistent with the linguistic sense of >> 'xor' ("You may have a soup (x)or a salad (x)or a cocktail"), and also >> with the IEEE 91 standard for logic gates.

Re: XOR does not work that way.

2009-06-22 Thread Minimiscience
On Jun 22, 2009, at 5:51 PM, Damian Conway wrote: Perl 6's approach to xor is consistent with the linguistic sense of 'xor' ("You may have a soup (x)or a salad (x)or a cocktail"), and also with the IEEE 91 standard for logic gates. I don't think natural language -- especially the abomination th

Re: XOR does not work that way.

2009-06-22 Thread Darren Duncan
Damian Conway wrote: Perl 6's approach to xor is consistent with the linguistic sense of 'xor' ("You may have a soup (x)or a salad (x)or a cocktail"), and also with the IEEE 91 standard for logic gates. See: http://ozark.hendrix.edu/~burch/logisim/docs/2.1.0/libs/gates/xor.html for a concis

Re: XOR does not work that way.

2009-06-22 Thread Damian Conway
Perl 6's approach to xor is consistent with the linguistic sense of 'xor' ("You may have a soup (x)or a salad (x)or a cocktail"), and also with the IEEE 91 standard for logic gates. See: http://ozark.hendrix.edu/~burch/logisim/docs/2.1.0/libs/gates/xor.html for a concise explanation of both t

Re: XOR does not work that way.

2009-06-22 Thread yary
I had a bit of a problem when first encountering xor with more than two operands as well. It made sense after I thought about it linguistically instead of mathematically. When speaking people often use a string of "or"s to mean "pick one and only one of these choices, the the exclusion of all other

XOR does not work that way.

2009-06-22 Thread Minimiscience
S03 describes ^^ as a "short‐circuit exclusive‐or" operator which returns true if & only if exactly one operand is true, short circuiting after encountering two true values. However, this definition is only consistent with the mathematical definition of XOR when the operation is being perf