From: Peter Vandenabeele Date: 2010-12-06T08:49:26+09:00 Subject: Re: Singleton class, metaclass, eigenclass: what do they mean? On Sun, Dec 5, 2010 at 11:49 PM, Rick DeNatale wrote: ... >>> The 'things' pointed to by klass pointers are either: >> >> Could this be a typo where you intended to say 'super' pointers? > > I think I should have said klass or superclass pointers. If I see correctly, those are really different things. The klass pointers for all "regular" classes (Class objects) and for virtual classes (singleton classes (of an object) and metaclasses (of a class), to follow your terminology) are all uniformily pointing to the Class object, so not much to see there ... What I was discussing is the 'super' chain that is relevant for method lookup. >> $ irb >> ruby-1.9.2-head > class A < Object; end >>  => nil >> ruby-1.9.2-head > A.singleton_class >>  => # >> ruby-1.9.2-head > A.singleton_class.superclass >>  => # >> >> > > That's a diference between Ruby 1.9 and 1.8  in 1.8.7 > > class B < A > end > > B.superclass # => A > b_sing = class << B; self; end > > b_sing.superclass # => # Indeed, I saw that too and I am confused by it ... (that's why I only reported the 1.9.2 case that I understand). If I understand correctly, also in ruby 1.8.7 the 'super' pointer of the metaclass of a class, really points to the metaclass of the superclass of that class (how else could B inherit the class methods of A ?). So I do not understand what this means ... b_sing.superclass # => # and even more confusing to me ... b_sing.superclass.superclass # => # It looks like there was a convention to report superclass of all virtual classes to be # (I do not understand that answer). Thanks for all you time into this ... Peter