Ok. Question was from Martin.
What behaviour we want from��WeakValueDictionary for garbaged values?
dictionary := WeakValueDictionary with: 'hello' -> 'world' copy.
Smalltalk garbageCollect.
{
dictionary values includes: nil.
dictionary at: 'hello'.
dictionary at: 'hello' ifAbsent: [ 'absent' ].
dictionary at: 'hello' ifAbsentPut: [ 'put' ].
}��
is:
#(true nil nil nil)
My opinion is: it should work in same way when 'hello' item is absent.
It is intuitive for me and It would be consistent to WeakSet behaviour:
set := WeakSet with: Object new.
Smalltalk garbageCollect.
set includes: nil "=>false"
But after writing it I realized how much WeakSet is��inconsistent:
set := WeakSet with: Object new.
Smalltalk garbageCollect.
set includes: nil. "=>false"
set collect: #yourself. "=>a WeakSet()"
We definitely have something to improve here.