add Module#remove_const

This commit is contained in:
Yukihiro Matz Matsumoto
2013-02-15 10:20:55 +09:00
parent 8578cd622b
commit 37fe3d666f
3 changed files with 24 additions and 1 deletions
+8 -1
View File
@@ -889,7 +889,7 @@ mrb_const_set(mrb_state *mrb, mrb_value mod, mrb_sym sym, mrb_value v)
mrb_iv_set(mrb, mod, sym, v);
}
void
void
mrb_vm_const_set(mrb_state *mrb, mrb_sym sym, mrb_value v)
{
struct RClass *c = mrb->ci->proc->target_class;
@@ -898,6 +898,13 @@ mrb_vm_const_set(mrb_state *mrb, mrb_sym sym, mrb_value v)
mrb_obj_iv_set(mrb, (struct RObject*)c, sym, v);
}
void
mrb_const_remove(mrb_state *mrb, mrb_value mod, mrb_sym sym)
{
mod_const_check(mrb, mod);
mrb_iv_remove(mrb, mod, sym);
}
void
mrb_define_const(mrb_state *mrb, struct RClass *mod, const char *name, mrb_value v)
{