Philip Newton wrote:
> Would it not be more natural to pass the *number* of lists to unzip,
> rather than the desired length? This way, unzip() would know to pick off
> elements two-at-a-time, three-at-a-time, etc., rather than having to go
> through the zipped list, count the elements, divide by $list_size, etc.
>
Could be. It's a bit more intuitive too, isn't it? (The 2nd param is the
'step size').

> Unless I misunderstood the example and you wanted the result to be
> ([1,2,3], [4,5,6]) in which case unzip would not have to do nearly as much
> work. But then (1..7) would unzip(3) into ([1,2,3], [4,5,6], [7]).

No, you didn't misunderstand. That's partition(), which is RFC 91.


Reply via email to