From 8ed70a5186f23ec9c3efe0dc91bda8dc4466b28c Mon Sep 17 00:00:00 2001 From: jeg2 Date: Tue, 8 Jan 2008 23:42:38 +0000 Subject: * 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 --- ChangeLog | 5 +++++ enum.c | 13 +++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index f7f9bbe48a..ea7d882ffd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Jan 9 08:42:01 2008 James Edward Gray II + + * 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 * enc/Makefile.in (BUILTIN_ENCS): UTF-{16,32}{BE,LE} are not builtin. diff --git a/enum.c b/enum.c index faa688e11f..917fe7486d 100644 --- a/enum.c +++ b/enum.c @@ -1400,18 +1400,19 @@ zip_i(VALUE val, NODE *memo, int argc, VALUE *argv) * * Takes one element from enum and merges corresponding * elements from each args. This generates a sequence of - * n-element arrays, where n is one more that the - * count of arguments. The length of the sequence is truncated to - * the size of the shortest argument (or enum). If a block - * given, it is invoked for each output array, otherwise an array of - * arrays is returned. + * n-element arrays, where n is one more than the + * count of arguments. The length of the resulting sequence will be + * enum#sizeenum#size, nil 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]] * */ -- cgit v1.2.1