Category: Language-Implementation
Superclass: ClassDescription
I am THE class object. My instances are the classes of the system. I provide information commonly attributed to classes: namely, the class name, class comment (you wouldn't be reading this if it weren't for me), a list of the instance variables of the class, and the class category.

Method category index

initialize (class)
accessing instances and variables (instance)
filing (instance)
instance creation (instance)
instance creation - alternative (instance)
pragmas (instance)
printing (instance)
saving and loading (instance)
still unclassified (instance)
testing (instance)
testing functionality (instance)

initialize (class)

initialize
Perform the special initialization of root classes.

top


accessing instances and variables (instance)

addClassVarName: aString
Add a class variable with the given name to the class pool dictionary.

addClassVarName: aString value: valueBlock

Add a class variable with the given name to the class pool dictionary, and evaluate valueBlock as its initializer.

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

bindingFor: aString

Answer the variable binding for the class variable with the given name

category

Answer the class category

category: aString

Change the class category to aString

classPool

Answer the class pool dictionary

classPragmas

Return the pragmas that are written in the file-out of this class.

classVarNames

Answer the names of the variables in the class pool dictionary

comment

Answer the class comment

comment: aString

Change the class name

environment

Answer `environment'.

environment: aNamespace

Set the receiver's environment to aNamespace and recompile everything

initialize

redefined in children (?)

initializeAsRootClass

Perform special initialization reserved to root classes.

name

Answer the class name

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

superclass: aClass

Set the receiver's superclass.

top


filing (instance)

fileOutDeclarationOn: aFileStream
File out class definition to aFileStream. Requires package Parser.

fileOutOn: aFileStream

File out complete class description: class definition, class and instance methods. Requires package Parser.

top


instance creation (instance)

extend
Redefine a version of the receiver in the current namespace. Note: this method can bite you in various ways when sent to system classes; read the section on namespaces in the manual for some examples of the problems you can encounter.

inheritShape

Answer whether subclasses will have by default the same shape as this class. The default is false.

subclass: classNameString

Define a subclass of the receiver with the given name. If the class is already defined, don't modify its instance or class variables but still, if necessary, recompile everything needed.

subclass: classNameString environment: aNamespace

Define a subclass of the receiver with the given name within aNamespace. If the class is already defined, don't modify its instance or class variables but still, if necessary, recompile everything needed.

subclass: classNameString instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames category: categoryNameString

Define a fixed subclass of the receiver with the given name, instance variables, class variables, pool dictionaries and category. If the class is already defined, if necessary, recompile everything needed.

variable: shape subclass: classNameString instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames category: categoryNameString

Define a variable subclass of the receiver with the given name, shape, instance variables, class variables, pool dictionaries and category. If the class is already defined, if necessary, recompile everything needed. The shape can be one of #byte #int8 #character #short #ushort #int #uint #int64 #uint64 #utf32 #float #double or #pointer.

variableByteSubclass: classNameString instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames category: categoryNameString

Define a byte variable subclass of the receiver with the given name, instance variables (must be ''), class variables, pool dictionaries and category. If the class is already defined, if necessary, recompile everything needed.

variableSubclass: classNameString instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames category: categoryNameString

Define a variable pointer subclass of the receiver with the given name, instance variables, class variables, pool dictionaries and category. If the class is already defined, if necessary, recompile everything needed.

variableWordSubclass: classNameString instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames category: categoryNameString

Define a word variable subclass of the receiver with the given name, instance variables (must be ''), class variables, pool dictionaries and category. If the class is already defined, if necessary, recompile everything needed.

top


instance creation - alternative (instance)

categoriesFor: method are: categories
Don't use this, it is only present to file in from IBM Smalltalk

subclass: classNameString classInstanceVariableNames: stringClassInstVarNames instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames

Don't use this, it is only present to file in from IBM Smalltalk

subclass: classNameString instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames

Don't use this, it is only present to file in from IBM Smalltalk

variableByteSubclass: classNameString classInstanceVariableNames: stringClassInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames

Don't use this, it is only present to file in from IBM Smalltalk

variableByteSubclass: classNameString classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames

Don't use this, it is only present to file in from IBM Smalltalk

variableLongSubclass: classNameString classInstanceVariableNames: stringClassInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames

Don't use this, it is only present to file in from IBM Smalltalk

variableLongSubclass: classNameString classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames

Don't use this, it is only present to file in from IBM Smalltalk

variableSubclass: classNameString classInstanceVariableNames: stringClassInstVarNames instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames

Don't use this, it is only present to file in from IBM Smalltalk

variableSubclass: classNameString instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames

Don't use this, it is only present to file in from IBM Smalltalk

top


pragmas (instance)

pragmaHandlerFor: aSymbol
Answer the (possibly inherited) registered handler for pragma aSymbol, or nil if not found.

registerHandler: aBlock forPragma: pragma

While compiling methods, on every encounter of the pragma with the given name, call aBlock with the CompiledMethod and an array of pragma argument values.

top


printing (instance)

article
Answer an article (`a' or `an') which is ok for the receiver's name

printOn: aStream

Print a representation of the receiver on aStream

storeOn: aStream

Store Smalltalk code compiling to the receiver on aStream

top


saving and loading (instance)

binaryRepresentationVersion
Answer a number >= 0 which represents the current version of the object's representation. The default implementation answers zero.

convertFromVersion: version withFixedVariables: fixed indexedVariables: indexed for: anObjectDumper

This method is called if a VersionableObjectProxy is attached to a class. It receives the version number that was stored for the object (or nil if the object did not use a VersionableObjectProxy), the fixed instance variables, the indexed instance variables, and the ObjectDumper that has read the object. The default implementation ignores the version and simply fills in an instance of the receiver with the given fixed and indexed instance variables (nil if the class instances are of fixed size). If instance variables were removed from the class, extras are ignored; if the class is now fixed and used to be indexed, indexed is not used.

nonVersionedInstSize

Answer the number of instance variables that the class used to have when objects were stored without using a VersionableObjectProxy. The default implementation answers the current instSize.

top


still unclassified (instance)

allSharedPoolDictionariesDo: aBlock
Answer the shared pools visible from methods in the metaclass, in the correct search order.

allSharedPoolDictionariesDo: aBlock overrideEnvironment: aNamespace

Answer the shared pools visible from methods in the class, in the correct search order. The receiver's environment is temporarily replaced with aNamespace

fileOutHeaderOn: aFileStream

Not commented.

top


testing (instance)

= aClass
Returns true if the two class objects are to be considered equal.

top


testing functionality (instance)

asClass
Answer the receiver.

isClass

Answer `true'.

top