Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 6.3.3 The Class Metaclass
- As objects, metaclasses are also instances of a class, and that class is
- also a metaclass since the metaclasses are class objects. However,
- unlike classes, all metaclasses share the same protocol, namely the
- message that creates their single instance. Therefore, the metaclass
- objects are all instances of the same class, namely the system class
- Metaclass. For any class C, the expression C class class returns
- Metaclass. Metaclass defines a single instance variable, thisClass,
- which refers to the metaclass's instance.
- Now consider Metaclass class, which is the metaclass of Metaclass. Every
- metaclass is an instance of Metaclass, so Metaclass class is an instance
- as well. Because Metaclass is the instance of Metaclass class, this is
- the point of circularity in the system with respect to class (i.e.,
- "instance of") references. The class/instance relationships among
- objects, classes, metaclasses, Metaclass and Metaclass class, are
- illustrated in Figure 6.6
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement