Category: Language-Implementation
Superclass: AbstractNamespace
I am a Namespace that has a super-namespace.

Method category index

accessing (class)
disabling instance creation (class)
initialization (class)
accessing (instance)
namespace hierarchy (instance)
overrides for superspaces (instance)
printing (instance)

accessing (class)

current
Answer the current namespace

current: aNamespaceOrClass

Set the current namespace to be aNamespace or, if it is a class, its class pool (the Dictionary that holds class variables).

top


disabling instance creation (class)

new
Disabled - use #addSubspace: to create instances

new: size

Disabled - use #addSubspace: to create instances

top


initialization (class)

initialize
This actually is not needed, the job could be done in dict.c (function namespace_new). But I'm lazy and I prefer to rely on the Smalltalk implementation of IdentitySet.

top


accessing (instance)

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

top


namespace hierarchy (instance)

siblings
Answer all the other namespaces that inherit from the receiver's superspace.

siblingsDo: aBlock

Evaluate aBlock once for each of the other namespaces that inherit from the receiver's superspace, passing the namespace as a parameter.

top


overrides for superspaces (instance)

associationAt: key ifAbsent: aBlock
Return the key/value pair associated to the variable named as specified by `key'. If the key is not found search will be brought on in superspaces, finally evaluating aBlock if the variable cannot be found in any of the superspaces.

associationsDo: aBlock

Pass each association in the namespace to aBlock

at: key ifAbsent: aBlock

Return the value associated to the variable named as specified by `key'. If the key is not found search will be brought on in superspaces, finally evaluating aBlock if the variable cannot be found in any of the superspaces.

at: key ifPresent: aBlock

If aKey is absent from the receiver and all its superspaces, answer nil. Else, evaluate aBlock passing the associated value and answer the result of the invocation

do: aBlock

Pass each value in the namespace to aBlock

includesKey: key

Answer whether the receiver or any of its superspaces contain the given key

keysAndValuesDo: aBlock

Pass to aBlock each of the receiver's keys and values, in two separate parameters

keysDo: aBlock

Pass to aBlock each of the receiver's keys

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.

size

Answer the number of keys in the receiver and each of its superspaces

top


printing (instance)

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

printOn: aStream in: aNamespace

Print on aStream some Smalltalk code compiling to the receiver when the current namespace is aNamespace

storeOn: aStream

Store Smalltalk code compiling to the receiver

top