remove: and GOODS -- identity problems?

Avi Bryant avi at beta4.com
Tue Jul 6 17:35:07 UTC 2004


On Jul 6, 2004, at 9:26 AM, Ragnar Hojland Espinosa wrote:

>> I can send you the code for the workaround if you like.
>> If somebody has a solution I would be interested. For the moment, I
>> just avoid storing sets in GOODS...
>
> Very interesting Adrian, it does indeed seem to be the problem here
> (digging around remove: does match your description)  I guess the best
> thing to do right now is follow your example and get rid of the sets.

It's a little  more specific than that - you need to get rid of Sets 
(and Dictionaries) that use #identityHash, whether directly 
(IdentitySet) or indirectly (because the objects they store don't 
override the default #hash).  If you are able to implement an alternate 
#hash for the objects you wish to store in the Set, everything should 
work just fine.

It's probably also worth implementing a KKIdentitySet especially for 
GOODS that uses the OID rather than #identityHash, for cases where 
identity really is all you have to go on.

Avi




More information about the Squeak-dev mailing list