From: Carlos Date: 2005-04-20T23:08:58+09:00 Subject: Re: [ANN] Article: Seeing Metaclasses Clearly [ts , 2005-04-20 15.42 CEST] > >>>>> "C" == Carlos writes: > > C> Before your discoveries make you jump into conclusions, you should apply a > C> little of scientific thought. You have two facts: one, that the diagram > C> shows that Object --instanceof--> (Object). The other: that > > More I follow this discussion, more I've problem. > > Where do you see (except in a book which don't describe the ruby object > model) that the diagram show > > "Object --instanceof--> (Object)" > > It's clearly stated > > Classes in Ruby are first-class objects---each is an instance of > class +Class+. > > and it don't exist an horizontal arrow for this case. Noo... I didn't see that anywhere, I wrote this in my diagram. Is it wrong? I saw that rb_obj_is_instance_of does: if (rb_obj_class(obj) == c) return Qtrue; and rb_obj_class does: return rb_class_real(CLASS_OF(obj)); and rb_class_real does: while (FL_TEST(cl, FL_SINGLETON) || TYPE(cl) == T_ICLASS) { cl = RCLASS(cl)->super; } So I thought it was skipping the singleton classes. Or isn't it? search_method, on the other hand, doesn't skip anything. From the above I deduced the diagram. In which step should I have applied a little more scientific thinking? :) Where does ruby search for methods, if not in the inheritance chain?