Back: MethodInfo-equality Up: Base classes Forward: Namespace class-accessing   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document

1.114 Namespace

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

1.114.1 Namespace class: accessing  (class)
1.114.2 Namespace class: disabling instance creation  (class)
1.114.3 Namespace class: initialization  (class)
1.114.4 Namespace: accessing  (instance)
1.114.5 Namespace: namespace hierarchy  (instance)
1.114.6 Namespace: overrides for superspaces  (instance)
1.114.7 Namespace: printing  (instance)


1.114.1 Namespace class: accessing

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


1.114.2 Namespace class: disabling instance creation

new
Disabled - use #addSubspace: to create instances

new: size
Disabled - use #addSubspace: to create instances


1.114.3 Namespace class: initialization

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.


1.114.4 Namespace: accessing

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


1.114.5 Namespace: namespace hierarchy

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.


1.114.6 Namespace: overrides for superspaces

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


1.114.7 Namespace: printing

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



Back: Namespace-overrides for superspaces Up: Namespace Forward: NetClients.URIResolver   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