Navigating traits in 3.9

Adrian Lienhard adi at netstyle.ch
Mon Oct 23 18:38:17 UTC 2006


How can an IdentitySet include two identical elements?!

The only thing I can think of is that the identityHash of an element  
changed. When ClassBuilder creates a new class to change the class  
references it does an #elementsForwardIdentityTo: which claims that  
"...the identityHashes remain with the pointers rather than with the  
objects so that the objects in this array should still be properly  
indexed in any existing hashed structures after the mutation.".

If not this, what else could cause the problem?

Adrian

Btw, sending a #rehash cleans the IdentitySets up


On Oct 23, 2006, at 19:54 , Andreas Raab wrote:

> Klaus D. Witzel wrote:
>> on Mon, 23 Oct 2006 10:35:13 +0200, you wrote:
>>> ... Looking at TCompilingBehavior's users I find TPureBehavior;  
>>> looking at TCompilingDescription's users I find ... "an  
>>> IdentitySet(ClassDescription ClassDescription TraitDescription)".  
>>> Huh? Anyone else seeing this? An identity set with a duplicate  
>>> entry?
>> Confirmed, printing "array fourth == array fifth" in an inspector  
>> on TCompilingDescription => true.
>
> And not only that. All of the following traits have duplicate users  
> and it's not limited to ClassDescription/TraitDescription either.
>
> TAccessingMethodDictDescription users
>   an IdentitySet(ClassDescription ClassDescription TraitDescription)
>
> TBasicCategorisingDescription users
>   an IdentitySet(ClassDescription ClassDescription TraitDescription)
>
> TBehaviorCategorization users
>   an IdentitySet(Trait Class Class Class)
>
> TCommentDescription users
>   an IdentitySet(ClassDescription ClassDescription TraitDescription)
>
> TCompilingDescription users
>   an IdentitySet(ClassDescription ClassDescription TraitDescription)
>
> TCopyingDescription users
>   an IdentitySet(ClassDescription ClassDescription TraitDescription)
>
> TFileInOutDescription users
>   an IdentitySet(ClassDescription ClassDescription TraitDescription)
>
> TPrintingDescription users
>   an IdentitySet(ClassDescription ClassDescription TraitDescription)
>
> TPureBehavior users
>   an IdentitySet(TraitBehavior Behavior Behavior)
>
> TTestingDescription users
>   an IdentitySet(ClassDescription ClassDescription TraitDescription)
>
> TTraitsCategorisingDescription users
>   an IdentitySet(ClassDescription ClassDescription TraitDescription)
>




More information about the Squeak-dev mailing list