diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-07-03 11:02:53 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-07-03 11:02:53 +0000 |
commit | 9d22a06ea06e9bec5030fd6e2c8481958fcd30d9 (patch) | |
tree | 58b15b4dc85acca1c806388ff3848a3c85fd0ebf /eval.c | |
parent | a11ab83884c47f729a8630ab5ef21c7522b48386 (diff) |
* array.c (rb_values_at): extract common procedure from
rb_ary_values_at. follow DRY principle.
* re.c (match_values_at): values_at should understand ranges.
* struct.c (rb_struct_values_at): ditto.
* struct.c (inspect_struct): inspect format changed; add "struct "
at the top.
* sprintf.c (rb_f_sprintf): "%p" specifier for inspect output.
(RCR#68)
* eval.c (rb_mod_undef_method): allow "undef_method" to accept
multiple arguments. (RCR#146)
* lib/timeout.rb: put timeout in Timeout module. (RCR#121)
[ruby-talk:61028]
* re.c (match_groups): new method added. (RCR#139)
* variable.c (rb_mod_const_of): should exclude constant defined
in Object, unless retrieving constants of Object.
* string.c (rb_str_new4): do not allocate new string if original
is frozen or already have copy-on-write entry. [ruby-talk:74940]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -362,6 +362,7 @@ rb_get_method_body(klassp, idp, noexp) body = ent->method = body->nd_head; } else { + if (BUILTIN_TYPE(origin) == T_ICLASS) origin = RBASIC(origin)->klass; *klassp = origin; ent->origin = origin; ent->mid = ent->mid0 = id; @@ -1824,10 +1825,16 @@ rb_undef(klass, id) } static VALUE -rb_mod_undef_method(mod, name) - VALUE mod, name; +rb_mod_undef_method(argc, argv, mod) + int argc; + VALUE *argv; + VALUE mod; { - rb_undef(mod, rb_to_id(name)); + int i; + + for (i=0; i<argc; i++) { + rb_undef(mod, rb_to_id(argv[i])); + } return mod; } @@ -6521,7 +6528,7 @@ Init_eval() rb_undef_method(rb_cClass, "module_function"); rb_define_private_method(rb_cModule, "remove_method", rb_mod_remove_method, 1); - rb_define_private_method(rb_cModule, "undef_method", rb_mod_undef_method, 1); + rb_define_private_method(rb_cModule, "undef_method", rb_mod_undef_method, -1); rb_define_private_method(rb_cModule, "alias_method", rb_mod_alias_method, 2); rb_define_private_method(rb_cModule, "define_method", rb_mod_define_method, -1); |