Skip to content

Commit 65fff9b

Browse files
committed
[operators] Range operators, associativity updates
1 parent bef4357 commit 65fff9b

File tree

1 file changed

+30
-5
lines changed

1 file changed

+30
-5
lines changed

lib/operators.pod

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ or C<fail()>, the old value is restored.
503503
504504
=head2 infix does
505505
506-
sub infix:<does>(Mu $obj, Mu $role)
506+
sub infix:<does>(Mu $obj, Mu $role) is assoc<none>
507507
508508
Mixes C<$role> into C<$obj> at run time. Requires C<$obj> to be mutable.
509509
@@ -512,7 +512,7 @@ to act like a role, for example enum values.
512512
513513
=head2 infix but
514514
515-
sub infix:<but>(Mu $obj, Mu $role)
515+
sub infix:<but>(Mu $obj, Mu $role) is assoc<none>
516516
517517
Creates a copy of C<$obj> with C<$role> mixed in. Since C<$obj> is not
518518
modified, C<but> can be used to created immutable values with mixins.
@@ -522,7 +522,7 @@ to act like a role, for example enum values.
522522
523523
=head2 infix cmp
524524
525-
multi sub infix:<cmp>($a, $b) returns Order:D
525+
multi sub infix:<cmp>($a, $b) returns Order:D is assoc<none>
526526
527527
Generic, "smart" three-way comparator.
528528
@@ -537,18 +537,43 @@ if C<$a eqv $b>, then C<$a cmp $b> always returns C<Order::Same>.
537537
538538
=head2 infix leg
539539
540-
multi sub infix:<leg>($a, $b) returns Order:D
540+
multi sub infix:<leg>($a, $b) returns Order:D is assoc<none>
541541
542542
String three-way comparator.
543543
544544
Coerces both arguments to L<Str>, and then does a lexicographic comparison.
545545
546546
=head2 infix <=>
547547
548-
multi sub infix:«<=>»($a, $b) returns Order:D
548+
multi sub infix:«<=>»($a, $b) returns Order:D is assoc<none>
549549
550550
Numeric three-way comparator.
551551
552552
Coerces both arguments to L<Real>, and then does a numeric comparison.
553553
554+
=head2 infix ..
555+
556+
multi sub infix:<..>($a, $b) returns Range:D is assoc<none>
557+
558+
Constructs a L<Range> from the arguments.
559+
560+
=head2 infix ..^
561+
562+
multi sub infix:<..^>($a, $b) returns Range:D is assoc<none>
563+
564+
Constructs a L<Range> from the arguments, excluding the end point.
565+
566+
=head2 infix ^..
567+
568+
multi sub infix:<^..>($a, $b) returns Range:D is assoc<none>
569+
570+
Constructs a L<Range> from the arguments, excluding the start point.
571+
572+
573+
=head2 infix ^..^
574+
575+
multi sub infix:<^..^>($a, $b) returns Range:D is assoc<none>
576+
577+
Constructs a L<Range> from the arguments, excluding both start and end point.
578+
554579
=end pod

0 commit comments

Comments
 (0)