On Wed, Jun 24, 2009 at 11:10:39AM -0700, Jon Lang wrote: > On Wed, Jun 24, 2009 at 10:35 AM, John Macdonald<j...@perlwolf.com> wrote: > > On Tue, Jun 23, 2009 at 07:51:45AM +1000, 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"), [ ... ] > > > > That choice tends to mean "exactly one", rather than "the first one > > the waiter hears". (A good waiter will explain the choice limitation > > at the time the order is made rather than having to deal with it > > being escalated to a complaint when the "missing" item is demanded.) > > > > Which means that short-circuiting is not right here - it must > > go through the entire list to determine whether there are zero > > true selections, find the first of exactly one true selections, > > or die if there are more than one true selections. > > Which, I believe, is exactly how XOR short-circuiting currently works: > it short-circuits to false if both sides are true; otherwise, it > returns true or false as usual for XOR and continues on down the > chain.
Failing to distinguish "zero" from "more than one" makes cases where xor is of any utility even more rare, it would seem to me (and it's already quite rare).