Dictionaries broken in 3.9a
Daniel Vainsencher
daniel.vainsencher at gmail.com
Tue Sep 20 10:21:06 UTC 2005
Chris Muller wrote:
[snip]
> Therefore, what do you think of my overriding #associationsDo: in
> WeakKeyDictionary, which was the real crux of my original fix back in June of
> '04? I should have just stopped with this..
>
> associationsDo: aBlock
> "Evaluate aBlock for each of the receiver's elements (key/value
> associations)."
>
> super associationsDo:
> [ : eachAssoc | | eachKey |
> eachKey _ eachAssoc key. "reference to ensure no GC"
> eachKey ifNotNil: [ aBlock value: eachAssoc ] ]
Well, I was quite disturbed to find out that:
1. #associationsDo: does not process all of the associations in the
dictionary.
That's what the message asks for, not all non-nil-key associations.
2. Finalization was completely broken by this change.
> I've run with this since that time without any problem, but even better with
> expert feedback.
Funny, I would have guessed that a lack of any finalization would affect
the functioning of something like Magma....
Daniel
More information about the Squeak-dev
mailing list
|