From: "Chr. Rippel" Date: 2002-01-08T10:19:22+09:00 Subject: Re: class name reported differently in different contexts wrote ..... > One way around would be to change the ruby's internal behaviour. It could > first create a class, then bind it into some constant and after that call > inherited. Then object space would be searchable to find a module which > contains the class which just inherited some other class (Ruby might be > even nice and send the context as a parameter). Well, I replaced the three offending lines 322-224 klass = rb_define_class_id(node->nd_cname, super); rb_const_set(ruby_class, node->nd_cname, klass); rb_set_class_path(klass,ruby_class,rb_id2name(node->nd_cname)); in eval.c with a call to klass = rb_define_class_id_bla(node->nd_cname, super,ruby_class); (defined in class.c & exported in inter.h) VALUE rb_define_class_id_bla(id, super,ruby_class) ID id; VALUE super,ruby_class; { VALUE klass; if (!super) super = rb_cObject; klass = rb_class_new(super); rb_name_class(klass, id); /* make metaclass */ RBASIC(klass)->klass = rb_singleton_class_new(RBASIC(super)->klass); rb_singleton_class_attached(RBASIC(klass)->klass, klass); /* added */ rb_const_set(ruby_class, id, klass); rb_set_class_path(klass,ruby_class,rb_id2name(id)); /* added */ rb_funcall(super, rb_intern("inherited"), 1, klass); return klass; } and everything went okay ... /Christoph