Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Spec List.(grep-index|first-index|first-rindex)
  • Loading branch information
lizmat committed Apr 28, 2014
1 parent 4a114b7 commit 85d112f
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions S32-setting-library/Containers.pod
Expand Up @@ -255,13 +255,38 @@ an argument will iterate or terminate the C<grep> itself, not some
loop surrounding the statement containing the C<grep>. Use a label
if you mean the other thing.

=item grep-index

multi method grep-index ( @values: Matcher $test --> List )
multi grep-index ( Matcher $test, *@values --> List )

Like C<grep>, but returns a lazy list of ordinal numbers of the matching
values, or C<Nil> if not found.

=item first

multi method first ( @values: Matcher $test --> Parcel )
multi first ( Matcher $test, *@values --> Parcel )

C<first> searches exactly like C<grep> but returns only the first matching value, or C<Nil>
if not found.
C<first> searches exactly like C<grep> but returns only the first matching
value, or C<Nil> if not found.

=item first-index

multi method first-index ( @values: Matcher $test --> Parcel )
multi first-index ( Matcher $test, *@values --> Parcel )

Like C<first>, but returns the ordinal number of the first matching value,
or C<Nil> if not found.

=item first-rindex

multi method first-rindex ( @values: Matcher $test --> Parcel )
multi first-rindex ( Matcher $test, *@values --> Parcel )

Like C<first-index>, but starts checking from the end of the C<List>. Returns
the ordinal number of the first matching value (counted from the beginning,
just as C<first-index>), or C<Nil> if not found.

=item pick

Expand Down

0 comments on commit 85d112f

Please sign in to comment.