From: Ilias Lazaridis Date: 2005-04-19T17:04:33+09:00 Subject: Re: - E03c - The Ruby Object Model (Revised Documentation) Saynatkari wrote: > Le 19/4/2005, "Ilias Lazaridis" a �crit: >>Jim Weirich wrote: >>>On Monday 18 April 2005 11:34 pm, Ilias Lazaridis wrote: >>> >>>>>There is another evident mistake in your UML diagram. Object doesn't >>>>>inherit from nil, nil is a literal and an instance of NilClass which >>>>>inherit from Object. >>>> >>>>you are wrong: >>>> >>>>irb(main):001:0> Object.superclass >>>>=> nil >>> >>>The documentation for superclass clearly states that it returns the superclass >>>of its target, or nil. >>> >>>In this case it returns nil because Object does not have a superclass, i.e. it >>>does not inherit from anything. >> >>In context of an Language Object Model: >> >>Object inherits from "nil". > > Er, no. Object does not inherit. As was pointed out to > you, #superclass just happens to return nil to signify > there is no superclass. you can express this as "Object inherits from nil". which is similar to "Object inherits from nothing". but the second is not true, as .superclass returns an object, which is "nil". >>"nil" is represented by an _instance_ of class "NilClass". >> >>I've drawn this instance "nil" into the diagram. >> >>[possibly it will be removed with the next revision] >> >>- >> >>Nil is a terribly confusing topic, thus I would prefere to keep is out >>of the currect topic. > > Why is it confusing? nil is 'nothing'. in context of Language Object models. see the thread below: >>You can review an old thread about smalltalk's Nil: >> >>comp.lang.smalltalk > ST - The Loneliness of Nil >>http://groups-beta.google.com/group/comp.lang.smalltalk/msg/f7f017a49e6268 .. -- http://lazaridis.com