In 2005 Larry wrote [1]: > [...] I think xor and ^^ > should be make list associative but execute left-to-right, short > circuiting on the second true discovered, so you have some hope of >ordering the harder conditions later in a sequence and bypassing them. > In either case the one true value is returned. This seems to me to > be the most useful semantics. [...]
[1] http://groups.google.com/group/perl.perl6.language/msg/36b680b042a3aece So for a long time I've been writing C<^^> and C<xor> with this idea in mind (which takes a bit of code to do). However, today it was pointed out to me that S03 says something different: Operator precedence: L Tight or || ^^ // min max L Loose or or xor orelse [...] C<< infix:<^^> >>, exclusive-or $x ^^ $y Returns the true argument if there is one (and only one). Returns C<Bool::False> if both arguments are false or both arguments are true. In list context forces a false return to mean C<()>. See C<xor> below for low-precedence version. This version of C<xor> showed up in r13540 (2007-01-27) -- prior to that the behavior of C<xor> wasn't described in S03. I'm totally fine with the new spec, but before I go ripping out the old code can I get confirmation that the current S03 description is the one to implement? Thanks! Pm