Category: Language-Implementation
Superclass: BindingDictionary
I am a special form of dictionary. Classes hold on an instance of me; it is called their `environment'.

Method category index

instance creation (class)
accessing (instance)
compiling (instance)
copying (instance)
namespace hierarchy (instance)
overrides for superspaces (instance)
printing (instance)
testing (instance)

instance creation (class)

new
Disabled - use #new to create instances

primNew: parent name: spaceName

Private - Create a new namespace with the given name and parent, and add to the parent a key that references it.

top


accessing (instance)

allAssociations
Answer a Dictionary with all of the associations in the receiver and each of its superspaces (duplicate keys are associated to the associations that are deeper in the namespace hierarchy)

allBehaviorsDo: aBlock

Evaluate aBlock once for each class and metaclass in the namespace.

allClassObjectsDo: aBlock

Evaluate aBlock once for each class and metaclass in the namespace.

allClassesDo: aBlock

Evaluate aBlock once for each class in the namespace.

allMetaclassesDo: aBlock

Evaluate aBlock once for each metaclass in the namespace.

classAt: aKey

Answer the value corrisponding to aKey if it is a class. Fail if either aKey is not found or it is associated to something different from a class.

classAt: aKey ifAbsent: aBlock

Answer the value corrisponding to aKey if it is a class. Evaluate aBlock and answer its result if either aKey is not found or it is associated to something different from a class.

top


compiling (instance)

addSharedPool: aDictionary
Import the given bindings for classes compiled with me as environment.

import: aDictionary

Import the given bindings for classes compiled with me as environment.

removeSharedPool: aDictionary

Remove aDictionary from my list of direct pools.

sharedPoolDictionaries

Answer the shared pools (not names) imported for my classes.

top


copying (instance)

copyEmpty: newSize
Answer an empty copy of the receiver whose size is newSize

whileCurrentDo: aBlock

Evaluate aBlock with the current namespace set to the receiver. Answer the result of the evaluation.

top


namespace hierarchy (instance)

addSubspace: aSymbol
Create a namespace named aSymbol, add it to the receiver's subspaces, and answer it.

allSubassociationsDo: aBlock

Invokes aBlock once for every association in each of the receiver's subspaces.

allSubspaces

Answer the direct and indirect subspaces of the receiver in a Set

allSubspacesDo: aBlock

Invokes aBlock for all subspaces, both direct and indirect.

allSuperspacesDo: aBlock

Evaluate aBlock once for each of the receiver's superspaces

includesClassNamed: aString

Answer whether the receiver or any of its superspaces include the given class -- note that this method (unlike #includesKey:) does not require aString to be interned and (unlike #includesGlobalNamed:) only returns true if the global is a class object.

includesGlobalNamed: aString

Answer whether the receiver or any of its superspaces include the given key -- note that this method (unlike #includesKey:) does not require aString to be interned but (unlike #includesClassNamed:) returns true even if the global is not a class object.

removeSubspace: aSymbol

Remove my subspace named aSymbol from the hierarchy.

selectSubspaces: aBlock

Return a Set of subspaces of the receiver satisfying aBlock.

selectSuperspaces: aBlock

Return a Set of superspaces of the receiver satisfying aBlock.

siblings

Answer all the other children of the same namespace as the receiver.

siblingsDo: aBlock

Evaluate aBlock once for each of the other root namespaces, passing the namespace as a parameter.

subspaces

Answer the receiver's direct subspaces

subspacesDo: aBlock

Invokes aBlock for all direct subspaces.

superspace

Answer the receiver's superspace.

superspace: aNamespace

Set the superspace of the receiver to be 'aNamespace'. Also adds the receiver as a subspace of it.

withAllSubspaces

Answer a Set containing the receiver together with its direct and indirect subspaces

withAllSubspacesDo: aBlock

Invokes aBlock for the receiver and all subclasses, both direct and indirect.

top


overrides for superspaces (instance)

inheritedKeys
Answer a Set of all the keys in the receiver and its superspaces

set: key to: newValue

Assign newValue to the variable named as specified by `key'. This method won't define a new variable; instead if the key is not found it will search in superspaces and raising an error if the variable cannot be found in any of the superspaces. Answer newValue.

set: key to: newValue ifAbsent: aBlock

Assign newValue to the variable named as specified by `key'. This method won't define a new variable; instead if the key is not found it will search in superspaces and evaluate aBlock if it is not found. Answer newValue.

values

Answer a Bag containing the values of the receiver

top


printing (instance)

name
Answer the receiver's name

name: aSymbol

Change the receiver's name to aSymbol

nameIn: aNamespace

Answer Smalltalk code compiling to the receiver when the current namespace is aNamespace

printOn: aStream

Print a representation of the receiver

storeOn: aStream

Store Smalltalk code compiling to the receiver

top


testing (instance)

isNamespace
Answer `true'.

isSmalltalk

Answer `false'.

top