ruby-changes:4910
From: ko1@a...
Date: Tue, 13 May 2008 15:13:14 +0900 (JST)
Subject: [ruby-changes:4910] knu - Ruby:r16403 (ruby_1_8): * enumerator.c: Update rdoc.
knu 2008-05-13 15:13:05 +0900 (Tue, 13 May 2008) New Revision: 16403 Modified files: branches/ruby_1_8/ChangeLog branches/ruby_1_8/NEWS branches/ruby_1_8/enumerator.c Log: * enumerator.c: Update rdoc. (enumerator_initialize): Discourage the use. (enum_each_slice, enum_each_cons, enumerator_each) (enumerator_with_index): Add a note about a call without a block. * NEWS: Intentionally omit enum_slice and enum_cons, which are removed in 1.9. http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/ChangeLog?r1=16403&r2=16402&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/enumerator.c?r1=16403&r2=16402&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/NEWS?r1=16403&r2=16402&diff_format=u Index: ruby_1_8/NEWS =================================================================== --- ruby_1_8/NEWS (revision 16402) +++ ruby_1_8/NEWS (revision 16403) @@ -87,9 +87,7 @@ New class for various enumeration defined by the enumerator library. * Enumerable#each_slice - * Enumerable#enum_slice * Enumerable#each_cons - * Enumerable#enum_cons * Object#to_enum * Object#enum_for Index: ruby_1_8/ChangeLog =================================================================== --- ruby_1_8/ChangeLog (revision 16402) +++ ruby_1_8/ChangeLog (revision 16403) @@ -1,3 +1,13 @@ +Tue May 13 15:10:50 2008 Akinori MUSHA <knu@i...> + + * enumerator.c: Update rdoc. + (enumerator_initialize): Discourage the use. + (enum_each_slice, enum_each_cons, enumerator_each) + (enumerator_with_index): Add a note about a call without a block. + + * NEWS: Intentionally omit enum_slice and enum_cons, which are + removed in 1.9. + Tue May 13 07:56:36 2008 Yukihiro Matsumoto <matz@r...> * string.c (rb_str_cat): fixed buffer overrun reported by Index: ruby_1_8/enumerator.c =================================================================== --- ruby_1_8/enumerator.c (revision 16402) +++ ruby_1_8/enumerator.c (revision 16403) @@ -138,8 +138,10 @@ /* * call-seq: * e.each_slice(n) {...} + * e.each_slice(n) * - * Iterates the given block for each slice of <n> elements. + * Iterates the given block for each slice of <n> elements. If no + * block is given, returns an enumerator. * * e.g.: * (1..10).each_slice(3) {|a| p a} @@ -192,9 +194,10 @@ /* * call-seq: * each_cons(n) {...} + * each_cons(n) * * Iterates the given block for each array of consecutive <n> - * elements. + * elements. If no block is given, returns an enumerator.a * * e.g.: * (1..10).each_cons(3) {|a| p a} @@ -271,12 +274,8 @@ * used as an Enumerable object using the given object's given * method with the given arguments. * - * e.g.: - * str = "xyz" - * - * enum = Enumerable::Enumerator.new(str, :each_byte) - * a = enum.map {|b| '%02x' % b } #=> ["78", "79", "7a"] - * + * Use of this method is not discouraged. Use Kernel#enum_for() + * instead. */ static VALUE enumerator_initialize(argc, argv, obj) @@ -330,7 +329,7 @@ * enum.each {...} * * Iterates the given block using the object and the method specified - * in the first place. + * in the first place. If no block is given, returns self. * */ static VALUE @@ -364,9 +363,10 @@ /* * call-seq: * e.with_index {|(*args), idx| ... } + * e.with_index * * Iterates the given block for each elements with an index, which - * start from 0. + * start from 0. If no block is given, returns an enumerator. * */ static VALUE -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/