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

1.1 AbstractNamespace

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

1.1.1 AbstractNamespace class: instance creation  (class)
1.1.2 AbstractNamespace: accessing  (instance)
1.1.3 AbstractNamespace: compiling  (instance)
1.1.4 AbstractNamespace: copying  (instance)
1.1.5 AbstractNamespace: namespace hierarchy  (instance)
1.1.6 AbstractNamespace: overrides for superspaces  (instance)
1.1.7 AbstractNamespace: printing  (instance)
1.1.8 AbstractNamespace: testing  (instance)


1.1.1 AbstractNamespace class: instance creation

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.


1.1.2 AbstractNamespace: accessing

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.


1.1.3 AbstractNamespace: compiling

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.


1.1.4 AbstractNamespace: copying

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.


1.1.5 AbstractNamespace: namespace hierarchy

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.


1.1.6 AbstractNamespace: overrides for superspaces

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


1.1.7 AbstractNamespace: printing

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


1.1.8 AbstractNamespace: testing

isNamespace
Answer `true'.

isSmalltalk
Answer `false'.



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


This document was generated on April, 16 2013 using texi2html