$sub->($_) for @$array;
}
-sub each_n {
+sub each_n_values {
my ($array, $n, $sub) = @_;
my $it = List::MoreUtils::natatime($n, @$array);
=item B<flatten_deep ($depth)>
-=item B<each_n ($n, $callback)>
+=item B<each_n_values ($n, $callback)>
=back
{
my @vals;
- @array->each_n(2, sub { push @vals, [@_] });
+ @array->each_n_values(2, sub { push @vals, [@_] });
is(scalar @vals, 13);
is(scalar @$_, 2) for @vals;
is_deeply(@vals->map(sub { @{ $_ } }), [@array]);
{
my @vals;
- $aref->each_n(2, sub { push @vals, [@_] });
+ $aref->each_n_values(2, sub { push @vals, [@_] });
is(scalar @vals, 13);
is(scalar @$_, 2) for @vals;
is_deeply(@vals->map(sub { @{ $_ } }), $aref);