Skip to content

Commit

Permalink
EXISTS-POS method added #2739
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniogamiz committed May 7, 2019
1 parent 7175096 commit b117438
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions doc/Type/Range.pod6
Expand Up @@ -353,6 +353,19 @@ Returns a pseudo-random value belonging to the range.
say (1^..5).rand; # OUTPUT: «1.02405550417031␤»
say (0.1..0.3).rand; # OUTPUT: «0.2130353370062␤»
=head2 method EXISTS-POS
Defined as
multi method EXISTS-POS(Range:D: int \pos)
multi method EXISTS-POS(Range:D: Int \pos)
Returns C<True> if C<pos> is greater or equal than zero and lower than
C<self.elems>. Returns C<False> otherwise.
say (6..10).EXISTS-POS(2) # OUTPUT: «True␤»
say (6..10).EXISTS-POS(7) # OUTPUT: «False␤»
=end pod

# vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6

0 comments on commit b117438

Please sign in to comment.