sub signatures coming

James Laver james.laver at
Tue Feb 25 11:27:49 GMT 2014

On 25 Feb 2014, at 11:18, James Laver <james.laver at> wrote:
> But I probably already have List::MoreUtils imported (because Perl).
> sub pairwise_sum ($a1, $a2) {
>  zip @$a1, @$a2;
> }
> And lets ignore the fact that the perl version that was used in the article was buggy. If $arg2 is shorter than $arg1 it breaks. zip’s supposed defined behaviour is to stop when either list runs out of elements.
> James

Oh, for bonus fun, I’d do it a different way in clojure (using a map):

(def pairwise-sum zipmap)

You might also have fun assuming[1] has anything to do with the zipmap function. If you actually figure out what a ‘zipper’ is, do please let me know because it’s been evading me for about a year.



More information about the mailing list