mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* object.c (Init_Object): added metameta-class initialization for
BasicObject, Object, and Module. The metameta-classes of them are now the metaclass of Class, as the metameta-calss of Class is. * object.c (boot_defmetametaclass): added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e4b3a81769
commit
975ecd2f3f
2 changed files with 18 additions and 0 deletions
|
@ -1,3 +1,12 @@
|
|||
Sun Sep 14 13:48:03 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
|
||||
|
||||
* object.c (Init_Object): added metameta-class initialization for
|
||||
BasicObject, Object, and Module.
|
||||
The metameta-classes of them are now the metaclass of Class, as the
|
||||
metameta-calss of Class is.
|
||||
|
||||
* object.c (boot_defmetametaclass): added.
|
||||
|
||||
Sun Sep 14 10:10:43 2008 Tadayoshi Funaba <tadf@dotrb.org>
|
||||
|
||||
* complex.c (f_{add,mul,sub}): omitted some shortcuts for preserve
|
||||
|
|
9
object.c
9
object.c
|
@ -2369,6 +2369,12 @@ boot_defclass(const char *name, VALUE super)
|
|||
return obj;
|
||||
}
|
||||
|
||||
static void
|
||||
boot_defmetametaclass(VALUE klass, VALUE metametaclass)
|
||||
{
|
||||
RBASIC(RBASIC(klass)->klass)->klass = metametaclass;
|
||||
}
|
||||
|
||||
/*
|
||||
* Document-class: Class
|
||||
*
|
||||
|
@ -2467,6 +2473,9 @@ Init_Object(void)
|
|||
metaclass = rb_make_metaclass(rb_cObject, metaclass);
|
||||
metaclass = rb_make_metaclass(rb_cModule, metaclass);
|
||||
metaclass = rb_make_metaclass(rb_cClass, metaclass);
|
||||
boot_defmetametaclass(rb_cModule, metaclass);
|
||||
boot_defmetametaclass(rb_cObject, metaclass);
|
||||
boot_defmetametaclass(rb_cBasicObject, metaclass);
|
||||
|
||||
rb_define_private_method(rb_cBasicObject, "initialize", rb_obj_dummy, 0);
|
||||
rb_define_alloc_func(rb_cBasicObject, rb_class_allocate_instance);
|
||||
|
|
Loading…
Add table
Reference in a new issue