method int-bounds
Documentation for method int-bounds
assembled from the following types:
class Range
From Range
(Range) method int-bounds
proto method int-bounds(|)multi method int-bounds()multi method int-bounds( is rw, is rw)
If the Range
is an integer range (as indicated by is-int), then this method returns a list with the first and last value it will iterate over (taking into account excludes-min and excludes-max). Returns a Failure if it is not an integer range.
say (2..5).int-bounds; # OUTPUT: «(2 5)»say (2..^5).int-bounds; # OUTPUT: «(2 4)»
If called with (writable) arguments, these will take the the values of the higher and lower bound:
(3..5).int-bounds( my , my );say "$min, $max" ; # OUTPUT: «3, 5»