зеркало из https://github.com/github/ruby.git
* 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
This commit is contained in:
Родитель
fdeb4b1384
Коммит
8ed70a5186
|
@ -1,3 +1,8 @@
|
|||
Wed Jan 9 08:42:01 2008 James Edward Gray II <jeg2@ruby-lang.org>
|
||||
|
||||
* enum.c: Updating the documentation of Enumrable#zip to reflect
|
||||
the recent changes Matz made to the method.
|
||||
|
||||
Wed Jan 9 01:35:10 2008 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* enc/Makefile.in (BUILTIN_ENCS): UTF-{16,32}{BE,LE} are not builtin.
|
||||
|
|
13
enum.c
13
enum.c
|
@ -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]]
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче