'From Cuis 1.0 of 16 July 2009 [latest update: #228] on 23 July 2009 at 3:28:38 pm'!

!WeakValueDictionary methodsFor: 'accessing' stamp: 'jmv 7/23/2009 15:27'!
at: key ifAbsentOrNil: aBlock
	"In a WeakValueDictionary, normally nil values (i.e. collected values) are considered the same as if the key/value was never added. Hence, this convenience method."
	
	| assoc |
	assoc _ array at: (self findElementOrNil: key).
	assoc ifNil: [ ^ aBlock value ].
	^ assoc value ifNil: [ aBlock value ]! !

!WeakValueDictionary methodsFor: 'accessing' stamp: 'jmv 7/23/2009 15:28'!
at: key ifAbsentOrNilPut: aBlock 
	"Return the value at the given key.
	If key is not included in the receiver store the result
	of evaluating aBlock as new value."
	^self at: key ifAbsentOrNil: [self at: key put: aBlock value]! !

