Magnitude weakSubclass: #WeakKeyAssociation instanceVariableNames: 'value' classVariableNames: '' category: 'Collections-Support'
weakSubclass: ... On 06 Sep 2014, at 16:47, Ben Coman <b...@openinworld.com> wrote: > > I'd like to learn a bit more about the implementation of Weak objects. For > example, I see... > > Magnitude>LookupKey>Associaton >> key: aKey value: anObject > key := aKey. > value := anObject > > Magnitude>LookupKey>WeakValueAssociaton >> key: aKey value: anObject > key := aKey. > self value: anObject > Magnitude>LookupKey>WeakValueAssociaton >> value: anObject > self at: 1 put: anObject > > Magnitude>WeakKeyAssociation >> key: aKey value: anObject > self basicAt: 1 put: aKey. > value := anObject > > The class definitions don't look any different to normal? I can see that > the weak classes are doing an #at:put: for their respective weak attribute, > but lots of non-weak classes also use that. > So what is it that makes WeakValueAssociaton & WeakKeyAssociation weak ? > > cheers -ben >