From: Ilias Lazaridis Date: 2005-04-19T13:59:34+09:00 Subject: Re: - E03c - The Ruby Object Model (Revised Documentation) 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". "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. 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/f7f017a49e6268e1 .. -- http://lazaridis.com