P2Hash

Implements a dictionary that stores objects indexed by keys. The keys are string types.

Factory Messages
OperationDescription

Operational Messages
OperationReturnDescription
at: aKey P2Object Answer the value associated with the given key. Throws a Ponder2ArgumentException error if not found.
at: aKey ifAbsent: aBlock P2Object Answer the value associated with the given key. If not found evaluate block (with no arguments) and return its result
at: aKey put: anObject P2Object Answer anObject. Store anObject in the table with aKey. If aKey already exists the previous value is overridden.
collect: aBlock P2Array Takes a block and executes the block once for each entry in the hash. The arguments to the block are the name of the entry and the value of the entry. The result of each block is collected and returned in an array.
do: aBlock self Takes a block and executes the block once for each entry in the hash. The arguments to the block are the name of the entry and the value of the entry. Answers with the receiver.
has: aKey boolean Answer true if the given key exists otherwise false
remove: aKey P2Object Answer the value associated with the given key and remove it from the table. Answer null if it is not found. TODO Should fail if not found