Skip to content

Commit 3fc8e26

Browse files
authored
Merge pull request #1460 from dmaestro/xor-operator
Add documentation of loose xor operator
2 parents 357e6e2 + 3186181 commit 3fc8e26

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

doc/Language/operators.pod6

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2264,7 +2264,7 @@ behaviour:
22642264
22652265
=head2 infix C«or»
22662266
2267-
Same as C<infix ||>, except with looser precedence.
2267+
Same as L<infix C<||>|#infix || >, except with looser precedence.
22682268
22692269
Returns the first argument that evaluates to C<True> in boolean context,
22702270
or otherwise the last argument, it short-circuits. Please note that C<or> is easy
@@ -2301,6 +2301,20 @@ while a L<Failure> never is:
23012301
meows-processor3; # OUTPUT: «something's wrong␤»
23022302
meows-processor3; # OUTPUT: «🐱␤»
23032303
2304+
=head2 infix C«xor»
2305+
2306+
Same as L<infix C<^^>|#infix ^^>, except with looser precedence.
2307+
2308+
Returns the operand that evaluates to C<True> in boolean context, if and
2309+
only if the other operand evaluates to C<False> in boolean context. If
2310+
both operands evaluate to C<False>, returns the last argument. If both
2311+
operands evalute to C<True>, returns C<Nil>.
2312+
2313+
When chaining, returns the operand that evaluates to C<True>, if and
2314+
only if there is one such operand. If more than one operand is true,
2315+
it short-cicuits after evaluating the second and returns C<Nil>. If all
2316+
operands are false, returns the last one.
2317+
23042318
=head1 Sequencer Precedence
23052319
23062320
=head2 infix C«==>»

0 commit comments

Comments
 (0)