diff options
author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-16 00:49:25 +0000 |
---|---|---|
committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-16 00:49:25 +0000 |
commit | 26101288eb58100ff394413a391fa6389e12a2ec (patch) | |
tree | e6b5dff7fd87f2037d81383fef1f3eb95cb4b98b /enumerator.c | |
parent | f83a409947b413231b4a5d7d7b457d67631cc32d (diff) | |
download | ruby-26101288eb58100ff394413a391fa6389e12a2ec.tar.gz ruby-26101288eb58100ff394413a391fa6389e12a2ec.tar.xz ruby-26101288eb58100ff394413a391fa6389e12a2ec.zip |
* enumerator.c (enumerator_with_object, Init_Enumerator):
Temporarily back out with_memo, for which we need a better name.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enumerator.c')
-rw-r--r-- | enumerator.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/enumerator.c b/enumerator.c index 3f5262670..c39a48ef7 100644 --- a/enumerator.c +++ b/enumerator.c @@ -357,15 +357,15 @@ enumerator_with_index(VALUE obj) } static VALUE -enumerator_with_memo_i(VALUE val, VALUE memo) +enumerator_with_object_i(VALUE val, VALUE memo) { return rb_yield_values(2, val, memo); } /* * call-seq: - * e.with_memo(obj) {|(*args), memo_obj| ... } - * e.with_memo(obj) + * e.with_object(obj) {|(*args), memo_obj| ... } + * e.with_object(obj) * * Iterates the given block for each element with an arbitrary * object given, and returns the memo object. @@ -374,7 +374,7 @@ enumerator_with_memo_i(VALUE val, VALUE memo) * */ static VALUE -enumerator_with_memo(VALUE obj, VALUE memo) +enumerator_with_object(VALUE obj, VALUE memo) { struct enumerator *e; int argc = 0; @@ -387,7 +387,7 @@ enumerator_with_memo(VALUE obj, VALUE memo) argv = RARRAY_PTR(e->args); } rb_block_call(e->obj, e->meth, argc, argv, - enumerator_with_memo_i, memo); + enumerator_with_object_i, memo); return memo; } @@ -489,7 +489,9 @@ Init_Enumerator(void) rb_define_method(rb_cEnumerator, "each", enumerator_each, 0); rb_define_method(rb_cEnumerator, "each_with_index", enumerator_with_index, 0); rb_define_method(rb_cEnumerator, "with_index", enumerator_with_index, 0); - rb_define_method(rb_cEnumerator, "with_memo", enumerator_with_memo, 1); +#if 0 + rb_define_method(rb_cEnumerator, "with_object", enumerator_with_object, 1); +#endif rb_define_method(rb_cEnumerator, "next", enumerator_next, 0); rb_define_method(rb_cEnumerator, "rewind", enumerator_rewind, 0); |