Category: Language-Implementation
Superclass: Dictionary
I am a special form of dictionary that provides special ways to access my keys, which typically begin with an uppercase letter; also, my associations are actually VariableBinding instances. My keys are (expected to be) symbols, so I use == to match searched keys to those in the dictionary -- this is done expecting that it brings a bit more speed.

Method category index

accessing (instance)
basic & copying (instance)
copying (instance)
forward declarations (instance)
printing (instance)
testing (instance)

accessing (instance)

define: aSymbol
Define aSymbol as equal to nil inside the receiver. Fail if such a variable already exists (use #at:put: if you don't want to fail)

doesNotUnderstand: aMessage

Try to map unary selectors to read accesses to the Namespace, and one-argument keyword selectors to write accesses. Note that: a) this works only if the selector has an uppercase first letter; and b) `aNamespace Variable: value' is the same as `aNamespace set: #Variable to: value', not the same as `aNamespace at: #Variable put: value' --- the latter always refers to the current namespace, while the former won't define a new variable, instead searching in superspaces (and raising an error if the variable cannot be found).

environment

Answer the environment to which the receiver is connected. This can be the class for a dictionary that holds class variables, or the super-namespace. In general it is used to compute the receiver's name.

environment: anObject

Set the environment to which the receiver is connected. This can be the class for a dictionary that holds class variables, or the super-namespace. In general it is used to compute the receiver's name.

import: aSymbol from: aNamespace

Add to the receiver the symbol aSymbol, associated to the same value as in aNamespace. Fail if aNamespace does not contain the given key.

name

Answer the receiver's name, which by default is the same as the name of the receiver's environment.

nameIn: aNamespace

Answer the receiver's name when referred to from aNamespace; by default the computation is deferred to the receiver's environment.

top


basic & copying (instance)

= arg
Answer whether the receiver is equal to arg. The equality test is by default the same as that for equal objects. = must not fail; answer false if the receiver cannot be compared to arg

hash

Answer an hash value for the receiver. This is the same as the object's #identityHash.

top


copying (instance)

copy
Answer the receiver.

copyEmpty: newSize

Answer an empty copy of the receiver whose size is newSize

copyEmptyForCollect

Answer an empty copy of the receiver which is filled in to compute the result of #collect:

copyEmptyForCollect: size

Answer an empty copy of the receiver which is filled in to compute the result of #collect:

deepCopy

Answer the receiver.

shallowCopy

Answer the receiver.

top


forward declarations (instance)

at: key put: value
Store value as associated to the given key. If any, recycle Associations temporarily stored by the compiler inside the `Undeclared' dictionary.

top


printing (instance)

printOn: aStream in: aNamespace
Print the receiver's name when referred to from aNamespace; by default the computation is deferred to the receiver's environment.

top


testing (instance)

species
Answer `IdentityDictionary'.

top