summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-25 08:49:32 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-25 08:49:32 +0000
commit82a408fb9d755b106be2cc23dd08831f158893f5 (patch)
treeed11d1b0761ad87968fbbc565696de0cebc3cc50 /eval.c
parent7c3d0ce3ccd5b3c1489dac2823f38d78f439456d (diff)
Revert r31873 Module#mix
* class.c (rb_mix_module): revert Module#mix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c61
1 files changed, 0 insertions, 61 deletions
diff --git a/eval.c b/eval.c
index 48276487ba..1203a20ecc 100644
--- a/eval.c
+++ b/eval.c
@@ -954,66 +954,6 @@ rb_mod_include(int argc, VALUE *argv, VALUE module)
return module;
}
-/*
- * call-seq:
- * mix(module, ...) -> module
- *
- * Mix +Module+> into self.
- */
-
-static VALUE
-rb_mod_mix_into(int argc, VALUE *argv, VALUE klass)
-{
- VALUE module, tmp, constants = Qnil, methods = Qnil;
- st_table *const_tbl = 0, *method_tbl = 0;
- int i = 0;
-
- rb_check_arity(argc, 1, 3);
- module = argv[i++];
-
- switch (TYPE(module)) {
- case T_CLASS:
- case T_MODULE:
- break;
- default:
- Check_Type(module, T_CLASS);
- break;
- }
- if (i < argc) {
- constants = argv[i++];
- if (!NIL_P(tmp = rb_check_array_type(constants))) {
- constants = tmp;
- }
- else if (!NIL_P(methods = rb_check_hash_type(constants))) {
- constants = Qnil;
- }
- else {
- Check_Type(constants, T_HASH);
- }
- }
- if (i < argc && NIL_P(methods)) {
- methods = argv[i++];
- if (NIL_P(tmp = rb_check_hash_type(methods))) {
- Check_Type(methods, T_HASH);
- }
- methods = tmp;
- }
- if (i < argc) rb_raise(rb_eArgError, "wrong arguments");
- if (!NIL_P(constants)) {
- VALUE hash = rb_hash_new();
- for (i = 0; i < RARRAY_LEN(constants); ++i) {
- rb_hash_update_by(hash, RARRAY_PTR(constants)[i], NULL);
- }
- const_tbl = RHASH_TBL(RB_GC_GUARD(constants) = hash);
- }
- if (!NIL_P(methods)) {
- method_tbl = RHASH_TBL(RB_GC_GUARD(methods));
- }
-
- rb_mix_module(klass, module, const_tbl, method_tbl);
- return module;
-}
-
void
rb_obj_call_init(VALUE obj, int argc, VALUE *argv)
{
@@ -1273,7 +1213,6 @@ Init_eval(void)
rb_define_private_method(rb_cModule, "append_features", rb_mod_append_features, 1);
rb_define_private_method(rb_cModule, "extend_object", rb_mod_extend_object, 1);
rb_define_private_method(rb_cModule, "include", rb_mod_include, -1);
- rb_define_private_method(rb_cModule, "mix", rb_mod_mix_into, -1);
rb_undef_method(rb_cClass, "module_function");