Stephen P. Potter wrote:
> | If the list to be unzipped is not an exact multiple of the partition
size,
> | the final list references are not padded--their length is one less than
> | the list size. For example:
> |
> |   @list = (1..7);
> |   @unzipped_list2 = unzip(3, \@list);   # ([1,4,7], [2,5], [3,6])
>
> This wording is confusing.  Is $list_size or "the partition size" supposed
> to be the length of each list, or the number of lists?  The way it is
> described leads me to think it should be the length of each list, but this
> example shows it being the number of lists. I would expect the
> @unzipped_list2 would return ([X,Y,Z], [A,B,C], [M]), although I can't
wrap
> my mind around which values should go where yet.
>
> It makes more sense for it to be the number of lists, in which case
> @unzipped_list should be ([1,4], [2,5], [3,6]) not ([1,3,5], [2,4,6]).
>
You're right, Stephen, it is confusing the way I wrote it. Sorry--I'll
redraft it today to try and make it more clear (and yes, I'm changing their
names too!)

I agree that the 2nd param would be more intuitive if it was the number of
lists. I'll make that change as well.

@unzipped_list2 should not be([X,Y,Z], [A,B,C], [M]). The RFC's proposed
behaviour makes it work as the inverse of zip(), which is the desired
behaviour.


Reply via email to