|
|
6.96 Metaclass
- Defined in namespace Smalltalk
- Category: Language-Implementation
- I am the root of the class hierarchy. My instances are metaclasses, one for
each real class. My instances have a single instance, which they hold
onto, which is the class that they are the metaclass of. I provide methods
for creation of actual class objects from metaclass object, and the creation
of metaclass objects, which are my instances. If this is confusing to you,
it should be...the Smalltalk metaclass system is strange and complex.
6.96.1 Metaclass class: instance creation
- subclassOf: superMeta
- Answer a new metaclass representing a subclass of superMeta
6.96.2 Metaclass: accessing
- instanceClass
- Answer the only instance of the metaclass
- primaryInstance
- Answer the only instance of the metaclass - present for compatibility
- soleInstance
- Answer the only instance of the metaclass - present for compatibility
6.96.3 Metaclass: basic
- instanceVariableNames: classInstVarNames
- Set the class-instance variables for the receiver to be those in classInstVarNames
- name: newName
- environment: aNamespace
subclassOf: superclass
instanceVariableNames: stringOfInstVarNames
variable: variableBoolean
words: wordBoolean
pointers: pointerBoolean
classVariableNames: stringOfClassVarNames
poolDictionaries: stringOfPoolNames
category: categoryName
Private - create a full featured class and install it, or change an existing one
- newMeta: className
- environment: aNamespace
subclassOf: superclass
instanceVariableNames: stringOfInstVarNames
variable: variableBoolean
words: wordBoolean
pointers: pointerBoolean
classVariableNames: stringOfClassVarNames
poolDictionaries: stringOfPoolNames
category: categoryName
Private - create a full featured class and install it
6.96.4 Metaclass: delegation
- addClassVarName: aString
- Add a class variable with the given name to the class pool dictionary
- addSharedPool: aDictionary
- Add the given shared pool to the list of the class' pool dictionaries
- allClassVarNames
- Answer the names of the variables in the receiver's class pool dictionary and in each of the superclasses' class pool dictionaries
- allSharedPools
- Return the names of the shared pools defined by the class and any of its superclasses
- category
- Answer the class category
- classPool
- Answer the class pool dictionary
- classVarNames
- Answer the names of the variables in the class pool dictionary
- comment
- Answer the class comment
- environment
- Answer the namespace in which the receiver is implemented
- name
- Answer the class name - it has none, actually
- removeClassVarName: aString
- Removes the class variable from the class, error if not present, or still in use.
- removeSharedPool: aDictionary
- Remove the given dictionary to the list of the class' pool dictionaries
- sharedPools
- Return the names of the shared pools defined by the class
6.96.5 Metaclass: filing
- fileOutOn: aFileStream
- File out complete class description: class definition, class and instance methods
6.96.6 Metaclass: printing
- nameIn: aNamespace
- Answer the class name when the class is referenced from aNamespace - a dummy one, since Behavior does not support names.
- printOn: aStream
- Print a represention of the receiver on aStream
- storeOn: aStream
- Store Smalltalk code compiling to the receiver on aStream
6.96.7 Metaclass: testing functionality
- asClass
- Answer `instanceClass'.
- isBehavior
- Answer `true'.
- isMetaclass
- Answer `true'.
|