Skip Menu |

This queue is for tickets about the Data-Unixish CPAN distribution.

Report information
The Basics
Id: 86430
Status: resolved
Priority: 0/
Queue: Data-Unixish

People
Owner: Nobody in particular
Requestors: perl [...] toby.ink
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: These functions seem like they'd be fairly useful (untested though)
sub map { my %args = @_; my ($in, $out, $code) = @args{qw/in out callback/}; local ($_, $.); while (($., $_) = each @$in) { push @$out, $code->(); } [200, "OK"]; } sub grep { my %args = @_; my ($in, $out, $code) = @args{qw/in out callback/}; local ($_, $.); while (($., $_) = each @$in) { push @$out, $_ if $code->(); } [200, "OK"]; } Also of use might be implementations of List::Util::first, List::Util::reduce, List::MoreUtils::natatime, List::MoreUtils::each_array, List::MoreUtils::part. If you're interested, I can contribute them with proper test cases, documentation, etc.
Hi Toby, Sure I'm interested. map and grep have already been on my todo list. The others look useful too. Regards, Steven On Wed Jun 26 05:09:41 2013, TOBYINK wrote: Show quoted text
> sub map { > my %args = @_; > my ($in, $out, $code) = @args{qw/in out callback/}; > local ($_, $.); > while (($., $_) = each @$in) { > push @$out, $code->(); > } > [200, "OK"]; > } > > sub grep { > my %args = @_; > my ($in, $out, $code) = @args{qw/in out callback/}; > local ($_, $.); > while (($., $_) = each @$in) { > push @$out, $_ if $code->(); > } > [200, "OK"]; > } > > Also of use might be implementations of List::Util::first, > List::Util::reduce, List::MoreUtils::natatime, > List::MoreUtils::each_array, List::MoreUtils::part. > > If you're interested, I can contribute them with proper test cases, > documentation, etc.
Thanks Toby, Merged, released. Regards, Steven On Wed Jun 26 05:28:34 2013, SHARYANTO wrote: Show quoted text
> Hi Toby, > > Sure I'm interested. map and grep have already been on my todo list. > The others look useful too. > > Regards, > Steven > > On Wed Jun 26 05:09:41 2013, TOBYINK wrote:
> > sub map { > > my %args = @_; > > my ($in, $out, $code) = @args{qw/in out callback/}; > > local ($_, $.); > > while (($., $_) = each @$in) { > > push @$out, $code->(); > > } > > [200, "OK"]; > > } > > > > sub grep { > > my %args = @_; > > my ($in, $out, $code) = @args{qw/in out callback/}; > > local ($_, $.); > > while (($., $_) = each @$in) { > > push @$out, $_ if $code->(); > > } > > [200, "OK"]; > > } > > > > Also of use might be implementations of List::Util::first, > > List::Util::reduce, List::MoreUtils::natatime, > > List::MoreUtils::each_array, List::MoreUtils::part. > > > > If you're interested, I can contribute them with proper test cases, > > documentation, etc.
> >