From: Ilias Lazaridis Date: 2005-04-20T18:24:35+09:00 Subject: Re: [EVALUATION] - E03d - The Ruby Object Model (End Game) Mark Hubbart wrote: > On 4/19/05, Ilias Lazaridis wrote: > >>[EVALUATION] - E03c - The Ruby Object Model (Revised Documentation) >>http://groups-beta.google.com/group/comp.lang.ruby/msg/b72b4a3bfd81a48e?hl=en >> >>- >> >>the above thread went a little out of control. >> >>The mostly discussed point (inherits from nil) has evolved and >> >>please focus on the essence: >> >>which is the term "metaclass" >> >>- >> >>cmd:> ri Class >> >>"Classes, modules, and objects are interrelated. In the diagram that >>follows, the arrows represent inheritance, and the parentheses >>meta-classes. All metaclasses are instances of the class `Class'." >> >> +------------------+ >> | | >> Object---->(Object) | >> ^ ^ ^ ^ | >> | | | | | >> | | +-----+ +---------+ | >> | | | | | >> | +-----------+ | | >> | | | | | >> +------+ | Module--->(Module) | >> | | ^ ^ | >> OtherClass-->(OtherClass) | | | >> | | | >> Class---->(Class) | >> ^ | >> | | >> +----------------+ >> >>- >> >>The above documentation is false. > > Not so. It is perhaps a bit unclear, but not incorrect. [...] > I should also add my voice to the throng complaining about the > 'Object.superclass == nil' issue. [...] please. The diagram has evolved in this point: http://lazaridis.com/case/lang/ruby/ >>The mentioned metaclasses like "(Class)" are not existent and not >>accessible whilst using standard Class/Object mechanisms. [...] >>If I am wrong, please show me how to access the metaclass: >> >>ClassMetaClass = Class.??? >> >>ClassMetaClass. > > Class's metaclass is Class. [...] "Class" is the _class_ of "Class", not its metaclass. - the above diagramm shows a "(Class)", which is documented as a "metaclass". How do I access this class? - the above diagramm shows a "(Object)", which inherits from "Class". how do I call "(Object).superclass"? - ruby is about fun and simplicity in programming? so, please show me how to play with those "metaclasses". [please without essay's] .. -- http://lazaridis.com