On 10/4/05, Juerd <[EMAIL PROTECTED]> wrote: > > What should zip do given 1..3 and 1..6? > > (a) 1 1 2 2 3 3 4 5 6 > (b) 1 1 2 2 3 3 undef 4 undef 5 undef 6 > (c) 1 1 2 2 3 3 > (d) fail > > I'd want c, mostly because of code like > > for @foo Y 0... -> $foo, $i { ... } > > Pugs currently does b.
Yeah. This is one of those things where it is hard to have a single function always DWYM. Algorithm::Loops solves this by just providing multiple functions. I can't see how to solve this using MMD alone. You would need to add an optional parameter that would specify behavior -min (zip to the smallest list) -undef (insert undefs as needed) -error (blow up if the lists are not equal in size) etc Juerd > Just my 2 cents from the peanut gallery. Cheers, Joshua Gatcomb a.k.a. L~R