Skip to content

Commit 4b0d38d

Browse files
committed
Comments behavior on negative gaps #2632
1 parent d75b8f7 commit 4b0d38d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

doc/Type/Any.pod6

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1465,10 +1465,21 @@ In this case, the first batch (ruled by an integer) has 3 elements; the second
14651465
one has 2 elements (key of the pair), but skips one (the number 8); the third
14661466
one has size 2 (because partials are allowed), and an overlap of 2 also.
14671467
1468+
The overlap cannot be larger than the sublist size; in that case, it will
1469+
throw an C<Exception>:
1470+
1471+
=for code :skip-list<Throws>
1472+
say (3..11).rotor(3, 2 => 1, 3 => -4, :partial);
1473+
# OUTPUT: «(exit code 1) Rotorizing gap is out of range. Is: -4, should be in
1474+
# -3..^Inf; ␤Ensure a negative gap is not larger than the length of the
1475+
# sublist␤ ␤␤»
1476+
14681477
Non-C<Int> values of C<$batch> will be coerced to Int:
14691478
14701479
say (3..9).rotor(3+⅓); # OUTPUT: «((3 4 5) (6 7 8))␤»
14711480
1481+
1482+
14721483
Please see also L<C<list.rotor>|/type/List#method_rotor> for examples applied to
14731484
lists.
14741485

0 commit comments

Comments
 (0)