diff options
author | jeg2 <jeg2@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-08 23:42:38 +0000 |
---|---|---|
committer | jeg2 <jeg2@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-08 23:42:38 +0000 |
commit | 8ed70a5186f23ec9c3efe0dc91bda8dc4466b28c (patch) | |
tree | 5e750fd30733bebffae7b762eed00acc242d9a33 /enum.c | |
parent | fdeb4b13846fdd72a89737ff813f2f8455da5327 (diff) |
* enum.c: Updating the documentation of Enumrable#zip to reflect
the recent changes Matz made to the method.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enum.c')
-rw-r--r-- | enum.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -1400,18 +1400,19 @@ zip_i(VALUE val, NODE *memo, int argc, VALUE *argv) * * Takes one element from <i>enum</i> and merges corresponding * elements from each <i>args</i>. This generates a sequence of - * <em>n</em>-element arrays, where <em>n</em> is one more that the - * count of arguments. The length of the sequence is truncated to - * the size of the shortest argument (or <i>enum</i>). If a block - * given, it is invoked for each output array, otherwise an array of - * arrays is returned. + * <em>n</em>-element arrays, where <em>n</em> is one more than the + * count of arguments. The length of the resulting sequence will be + * <code>enum#size</code. If the size of any argument is less than + * <code>enum#size</code>, <code>nil</code> values are supplied. If + * a block is given, it is invoked for each output array, otherwise + * an array of arrays is returned. * * a = [ 4, 5, 6 ] * b = [ 7, 8, 9 ] * * [1,2,3].zip(a, b) #=> [[1, 4, 7], [2, 5, 8], [3, 6, 9]] * [1,2].zip(a,b) #=> [[1, 4, 7], [2, 5, 8]] - * a.zip([1,2],[8]) #=> [[4,1,8]] + * a.zip([1,2],[8]) #=> [[4, 1, 8], [5, 2, nil], [6, nil, nil]] * */ |