sub signatures coming

Will Crawford billcrawford1970 at gmail.com
Tue Feb 25 11:01:46 GMT 2014


On 25 February 2014 03:45, Paul Makepeace <paulm at paulm.com> wrote:

> Finally. But don't believe the python/perl comparison troll, as
> python, for once, actually outguns perl on a character chomping basis,
>
> sub pairwise_sum ($arg1, $arg2) {
>     return map { $arg1->[$_] + $arg2->[$_] } 0 .. $#$arg1;
> }
>
> def pairwise_sum(list1, list2):
>     return [i + j for i, j in zip(list1, list2)]

List::Util and List::MoreUtils go partway to fixing that, but yes, a
"native" zip/unzip operation would be nice :)

> Paul


More information about the london.pm mailing list