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

ruby-changes:30920

From: zzak <ko1@a...>
Date: Sat, 21 Sep 2013 00:49:47 +0900 (JST)
Subject: [ruby-changes:30920] zzak:r42999 (trunk): * enum.c: [DOC] Enumerable#to_a accepts arguments [GH-388]

zzak	2013-09-21 00:49:42 +0900 (Sat, 21 Sep 2013)

  New Revision: 42999

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42999

  Log:
    * enum.c: [DOC] Enumerable#to_a accepts arguments [GH-388]
      Patch by @kachick https://github.com/ruby/ruby/pull/388

  Modified files:
    trunk/ChangeLog
    trunk/enum.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 42998)
+++ ChangeLog	(revision 42999)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Sep 21 00:49:16 2013  Zachary Scott  <e@z...>
+
+	* enum.c: [DOC] Enumerable#to_a accepts arguments [GH-388]
+	  Patch by @kachick https://github.com/ruby/ruby/pull/388
+
 Sat Sep 21 00:47:44 2013  Nobuyoshi Nakada  <nobu@r...>
 
 	* string.c (rb_str_conv_enc_opts): make sure to scan coderange to get
Index: enum.c
===================================================================
--- enum.c	(revision 42998)
+++ enum.c	(revision 42999)
@@ -487,13 +487,16 @@ enum_flat_map(VALUE obj) https://github.com/ruby/ruby/blob/trunk/enum.c#L487
 
 /*
  *  call-seq:
- *     enum.to_a      -> array
- *     enum.entries   -> array
+ *     enum.to_a(*args)      -> array
+ *     enum.entries(*args)   -> array
  *
  *  Returns an array containing the items in <i>enum</i>.
  *
  *     (1..7).to_a                       #=> [1, 2, 3, 4, 5, 6, 7]
  *     { 'a'=>1, 'b'=>2, 'c'=>3 }.to_a   #=> [["a", 1], ["b", 2], ["c", 3]]
+ *
+ *     require 'prime'
+ *     Prime.entries 10                  #=> [2, 3, 5, 7]
  */
 static VALUE
 enum_to_a(int argc, VALUE *argv, VALUE obj)

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

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