mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 13:04:13 +02:00
* ext/enumerator/enumerator.c, ext/enumerator/enumerator.txt:
Provide Kernel#to_enum as an alias for Kernel#enum_for. Maybe this is a better name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a7ddb2e342
commit
23f6b5bdc4
3 changed files with 14 additions and 2 deletions
|
@ -20,7 +20,7 @@ static ID sym_each, sym_each_with_index, sym_each_slice, sym_each_cons;
|
|||
static ID id_new, id_enum_obj, id_enum_method, id_enum_args;
|
||||
|
||||
static VALUE
|
||||
obj_enum_for(obj, enum_args)
|
||||
obj_to_enum(obj, enum_args)
|
||||
VALUE obj, enum_args;
|
||||
{
|
||||
rb_ary_unshift(enum_args, obj);
|
||||
|
@ -172,7 +172,8 @@ Init_enumerator()
|
|||
{
|
||||
VALUE rb_mEnumerable;
|
||||
|
||||
rb_define_method(rb_mKernel, "enum_for", obj_enum_for, -2);
|
||||
rb_define_method(rb_mKernel, "to_enum", obj_to_enum, -2);
|
||||
rb_define_method(rb_mKernel, "enum_for", obj_to_enum, -2);
|
||||
|
||||
rb_mEnumerable = rb_path2class("Enumerable");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue