Clarify natatime Array helper behavior when given a code ref
[gitmo/Moose.git] / lib / Moose / Meta / Attribute / Native / Trait / Array.pm
index 29916ec..a7046a2 100644 (file)
@@ -133,7 +133,7 @@ This method requires at least one argument.
 
 =item * B<first( sub { ... } )>
 
-This method returns the first item matching item in the array, just like
+This method returns the first matching item in the array, just like
 L<List::Util>'s C<first> function. The matching is done with a subroutine
 reference you pass to this method. The subroutine will be called against each
 element in the array until one matches or all elements have been checked.
@@ -143,6 +143,16 @@ element in the array until one matches or all elements have been checked.
 
 This method requires a single argument.
 
+=item * B<first_index( sub { ... } )>
+
+This method returns the index of the first matching item in the array, just
+like L<List::MoreUtils>'s C<first_index> function. The matching is done with a
+subroutine reference you pass to this method. The subroutine will be called
+against each element in the array until one matches or all elements have been
+checked.
+
+This method requires a single argument.
+
 =item * B<grep( sub { ... } )>
 
 This method returns every element matching a given criteria, just like Perl's
@@ -284,12 +294,21 @@ This method accepts one or two arguments.
 =item * B<natatime($n, $code)>
 
 This method returns an iterator which, on each call, returns C<$n> more items
-from the array, in order, like C<natatime> from L<List::MoreUtils>. A coderef
-can optionally be provided; it will be called on each group of C<$n> elements
-in the array.
+from the array, in order, like C<natatime> from L<List::MoreUtils>.
+
+If you pass a coderef as the second argument, then this code ref will be
+called on each group of C<$n> elements in the array until the array is
+exhausted.
 
 This method accepts one or two arguments.
 
+=item * B<shallow_clone>
+
+This method returns a shallow clone of the array reference.  The return value
+is a reference to a new array with the same elements.  It is I<shallow>
+because any elements that were references in the original will be the I<same>
+references in the clone.
+
 =back
 
 =head1 BUGS