Skip to content

Commit 0e52ddf

Browse files
committed
Documents int-bounds
Actually, the included definition was also wrong. Closes #2239
1 parent ea16117 commit 0e52ddf

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

doc/Type/Range.pod6

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,9 @@ Returns C<True> if both end points are C<Int> values.
243243
244244
=head2 method int-bounds
245245
246-
method int-bounds(Range:D: --> Positional)
246+
proto method int-bounds(|)
247+
multi method int-bounds()
248+
multi method int-bounds($from is rw, $to is rw)
247249
248250
If the C<Range> is an integer range (as indicated by L<is-int|/routine/is-int>), then this
249251
method returns a list with the first and last value it will iterate over
@@ -253,6 +255,13 @@ Failure if it is not an integer range.
253255
say (2..5).int-bounds; # OUTPUT: «(2 5)␤»
254256
say (2..^5).int-bounds; # OUTPUT: «(2 4)␤»
255257
258+
If called with (writable) arguments, these will take the the values of the
259+
higher and lower bound:
260+
261+
(3..5).int-bounds( my $min, my $max);
262+
say "$min, $max" ; # OUTPUT: «3, 5␤»
263+
264+
256265
=head2 method minmax
257266
258267
Defined as:

0 commit comments

Comments
 (0)