method int-bounds
1 | class Range |
1.1 | (Range) 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 --> Bool)
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 values of the higher and lower bound and returns whether integer bounds could be determined from the Range
:
if (3..5).int-bounds( my , my )else