File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -243,7 +243,9 @@ Returns C<True> if both end points are C<Int> values.
243
243
244
244
= head2 method int-bounds
245
245
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)
247
249
248
250
If the C < Range > is an integer range (as indicated by L < is-int|/routine/is-int > ), then this
249
251
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.
253
255
say (2..5).int-bounds; # OUTPUT: «(2 5)»
254
256
say (2..^5).int-bounds; # OUTPUT: «(2 4)»
255
257
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
+
256
265
= head2 method minmax
257
266
258
267
Defined as:
You can’t perform that action at this time.
0 commit comments