From: "Mauricio FernŠŌdez"
>
> [...] there's no reason to keep AFAIK.
>

Support here :-)
(I tried hard to bust it apart visually).

Seems it would still give correct nils when array lengths differ.

%w{A B C D E}.zip([1,2,3]) {|ra| p ra}

#-> ["A", 1]
#-> ["B", 2]
#-> ["C", 3]
#-> ["D", nil]
#-> ["E", nil]


Compulsive tidiness would lead me to set:

    long len = RARRAY(ary)->len;

as the declaration and use that in the same way as the non-block
version (removing the assignment, there).

Gosh - and then that "array assurance" loop at the top could, so easily,
be "enhanced" to:

    for (i=0; i<argc; i++) {
        argv[i] = to_ary(argv[i]);
        if (len < RARRAY(argv[i])->len)
            len = RARRAY(argv[i])->len;    /* set for longest array */
    }

so that:

['A'].zip([1,2,3]) {|ra| p ra}

instead of stopping at:

  #-> ["A", 1]

would result in:

  #-> ["A", 1]
  #-> [nil, 2]
  #-> [nil, 3]

But that would be a change in behaviour and has probably been
discussed - and discarded - elsewhere.


daz