From: Rick DeNatale Date: 2010-12-06T11:00:53+09:00 Subject: Re: Singleton class, metaclass, eigenclass: what do they mean? On Sun, Dec 5, 2010 at 6:49 PM, Peter Vandenabeele wrote: > 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. > No, the klass pointer in the object header points to the beginning of the chain of structures (in the C language sense) which point to method tables to search for method lookup, the superclass pointer is the 'next' link in those chains. In the case of an object with singleton methods, klass will point to the singleton class and it's superclass pointer will either point to the objects 'real' class or to a chain of one or more module proxies inserted before that class if the object has extended any module. -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Github: http://github.com/rubyredrick Twitter: @RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale