[前][次][番号順一覧][スレッド一覧]

ruby-changes:3466

From: ko1@a...
Date: 9 Jan 2008 09:12:16 +0900
Subject: [ruby-changes:3466] jeg2 - Ruby:r14959 (trunk): * enum.c: Updating the documentation of Enumrable#zip to reflect

jeg2	2008-01-09 08:42:38 +0900 (Wed, 09 Jan 2008)

  New Revision: 14959

  Modified files:
    trunk/ChangeLog
    trunk/enum.c

  Log:
    * enum.c:  Updating the documentation of Enumrable#zip to reflect
      the recent changes Matz made to the method.


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=14959&r2=14958&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/enum.c?r1=14959&r2=14958&diff_format=u

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 14958)
+++ ChangeLog	(revision 14959)
@@ -1,3 +1,8 @@
+Wed Jan  9 08:42:01 2008  James Edward Gray II  <jeg2@r...>
+
+	* 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@r...>
 
 	* enc/Makefile.in (BUILTIN_ENCS): UTF-{16,32}{BE,LE} are not builtin.
Index: enum.c
===================================================================
--- enum.c	(revision 14958)
+++ enum.c	(revision 14959)
@@ -1400,18 +1400,19 @@
  *  
  *  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]]
  *     
  */
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml

[前][次][番号順一覧][スレッド一覧]