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

* enum.c (enum_one, enum_take_while, enum_drop_while): fix documents.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
mame 2008-01-24 14:23:51 +00:00
parent 14b9d47ae0
commit 0dba38026a
2 changed files with 10 additions and 5 deletions

View file

@ -1,3 +1,7 @@
Thu Jan 24 23:23:06 2008 Yusuke Endoh <mame@tsg.ne.jp>
* enum.c (enum_one, enum_take_while, enum_drop_while): fix documents.
Thu Jan 24 21:46:24 2008 Tanaka Akira <akr@fsij.org> Thu Jan 24 21:46:24 2008 Tanaka Akira <akr@fsij.org>
* parse.y (reg_fragment_setenc_gen): associate ASCII-8BIT only if * parse.y (reg_fragment_setenc_gen): associate ASCII-8BIT only if
@ -97,7 +101,7 @@ Thu Jan 24 03:23:44 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
Thu Jan 24 02:13:07 2008 Yusuke Endoh <mame@tsg.ne.jp> Thu Jan 24 02:13:07 2008 Yusuke Endoh <mame@tsg.ne.jp>
* insns.def (expandarray): fix stack inc. * insns.def (expandarray): fix stack inc. [ruby-dev:32892]
* bootstraptest/test_knownbug.rb, test_massign.rb: move a fixed test. * bootstraptest/test_knownbug.rb, test_massign.rb: move a fixed test.
Thu Jan 24 01:00:34 2008 NARUSE, Yui <naruse@ruby-lang.org> Thu Jan 24 01:00:34 2008 NARUSE, Yui <naruse@ruby-lang.org>

9
enum.c
View file

@ -863,7 +863,8 @@ one_iter_i(VALUE i, VALUE *memo)
* true. * true.
* *
* %w{ant bear cat}.one? {|word| word.length == 4} #=> true * %w{ant bear cat}.one? {|word| word.length == 4} #=> true
* %w{ant bear cat}.one? {|word| word.length >= 4} #=> false * %w{ant bear cat}.one? {|word| word.length > 4} #=> false
* %w{ant bear cat}.one? {|word| word.length < 4} #=> false
* [ nil, true, 99 ].one? #=> false * [ nil, true, 99 ].one? #=> false
* [ nil, true, false ].one? #=> true * [ nil, true, false ].one? #=> true
* *
@ -1223,7 +1224,7 @@ enum_max_by(VALUE obj)
rb_block_call(obj, id_each, 0, 0, max_by_i, (VALUE)memo); rb_block_call(obj, id_each, 0, 0, max_by_i, (VALUE)memo);
return memo[1]; return memo[1];
} }
static VALUE static VALUE
minmax_by_i(VALUE i, VALUE *memo, int argc, VALUE *argv) minmax_by_i(VALUE i, VALUE *memo, int argc, VALUE *argv)
{ {
@ -1484,7 +1485,7 @@ take_while_i(VALUE i, VALUE *ary, int argc, VALUE *argv)
* then stops iterating and returns an array of all prior elements. * then stops iterating and returns an array of all prior elements.
* *
* a = [1, 2, 3, 4, 5, 0] * a = [1, 2, 3, 4, 5, 0]
* a.take {|i| i < 3 } # => [1, 2] * a.take_while {|i| i < 3 } # => [1, 2]
* *
*/ */
@ -1556,7 +1557,7 @@ drop_while_i(VALUE i, VALUE *args, int argc, VALUE *argv)
* containing the remaining elements. * containing the remaining elements.
* *
* a = [1, 2, 3, 4, 5, 0] * a = [1, 2, 3, 4, 5, 0]
* a.drop {|i| i < 3 } # => [3, 4, 5, 0] * a.drop_while {|i| i < 3 } # => [3, 4, 5, 0]
* *
*/ */