1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
knu 2008-05-13 06:13:05 +00:00
parent 28693296b7
commit 8cf1995901
3 changed files with 20 additions and 12 deletions

View file

@ -1,3 +1,13 @@
Tue May 13 15:10:50 2008 Akinori MUSHA <knu@iDaemons.org>
* 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@ruby-lang.org>
* string.c (rb_str_cat): fixed buffer overrun reported by

2
NEWS
View file

@ -87,9 +87,7 @@ with all sufficient information, see the ChangeLog file.
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

View file

@ -138,8 +138,10 @@ each_slice_i(val, memo)
/*
* 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 @@ each_cons_i(val, memo)
/*
* 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 @@ enumerator_init(enum_obj, obj, meth, argc, argv)
* 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 @@ rb_enumeratorize(obj, meth, argc, argv)
* 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 @@ enumerator_with_index_i(val, memo)
/*
* 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