Created
June 27, 2016 15:17
-
-
Save dogbert17/f3ebc0f42320f2998eff513466f12bc6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=head2 method minmax | |
Defined as: | |
multi method minmax(Range:D:) returns List:D | |
If the C<Range> is an integer range (as indicated by L<is-int>), then this | |
method returns a list with the first and last value it will iterate over | |
(taking into account L<excludes-min> and L<excludes-max>). If the range is | |
not an integer range, the method will return a two element list containing | |
the start and end point of the range unless either of L<excludes-min> or | |
L<excludes-max> are C<True> in which case a L<Failure|/type/Failure> is returned. | |
say (1..5).minmax; # (1 5) | |
say (1^..5).minmax; # (2 5) | |
say (1.1..5.2).minmax; # (1.1 5.2) | |
say (1.1..^5.2).minmax; # Failure |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment