Lightning flashed, thunder crashed and Perl6 RFC Librarian <[EMAIL PROTECTED]>
 whispered:
| =head1 TITLE
| 
| Builtins: zip() and unzip()
|
[snip]
| 
| its arguments. C<unzip($list_size, \@list)> would reverse this operation.
| 
[snip]
|
| 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]).

-spp

Reply via email to