Back: MessageNotUnderstood-description Up: Base classes Forward: Metaclass class-instance creation   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document

1.110 Metaclass

Defined in namespace Smalltalk
Superclass: ClassDescription
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.

1.110.1 Metaclass class: instance creation  (class)
1.110.2 Metaclass: accessing  (instance)
1.110.3 Metaclass: basic  (instance)
1.110.4 Metaclass: compiling methods  (instance)
1.110.5 Metaclass: delegation  (instance)
1.110.6 Metaclass: filing  (instance)
1.110.7 Metaclass: printing  (instance)
1.110.8 Metaclass: testing functionality  (instance)


1.110.1 Metaclass class: instance creation

subclassOf: superMeta
Answer a new metaclass representing a subclass of superMeta


1.110.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


1.110.3 Metaclass: basic

name: className environment: aNamespace subclassOf: theSuperclass
Private - create a full featured class and install it, or change the superclass or shape of an existing one; instance variable names, class variable names and pool dictionaries are left untouched.

name: className environment: aNamespace subclassOf: newSuperclass instanceVariableArray: variableArray shape: shape classPool: classVarDict poolDictionaries: sharedPoolNames category: categoryName
Private - create a full featured class and install it, or change an existing one

name: newName environment: aNamespace subclassOf: theSuperclass instanceVariableNames: stringOfInstVarNames shape: shape classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames category: categoryName
Private - parse the instance and class variables, and the pool dictionaries, then create the class.

newMeta: className environment: aNamespace subclassOf: theSuperclass instanceVariableArray: arrayOfInstVarNames shape: shape classPool: classVarDict poolDictionaries: sharedPoolNames category: categoryName
Private - create a full featured class and install it


1.110.4 Metaclass: compiling methods

poolResolution
Use my instance's poolResolution.


1.110.5 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

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

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

debuggerClass
Answer the debugger class that was set in the instance class

environment
Answer the namespace in which the receiver is implemented

name
Answer the class name - it has none, actually

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

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


1.110.6 Metaclass: filing

fileOutOn: aFileStream
File out complete class description: class definition, class and instance methods


1.110.7 Metaclass: printing

nameIn: aNamespace
Answer the class name when the class is referenced from aNamespace.

printOn: aStream
Print a represention of the receiver on aStream

printOn: aStream in: aNamespace
Print on aStream the class name when the class is referenced from aNamespace.

storeOn: aStream
Store Smalltalk code compiling to the receiver on aStream


1.110.8 Metaclass: testing functionality

asClass
Answer `instanceClass'.

isMetaclass
Answer `true'.



Back: Metaclass-printing Up: Metaclass Forward: MethodContext   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document


This document was generated on August, 19 2010 using texi2html