Bag strange behaviour

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Bag strange behaviour

dtrussardi@tiscali.it
I have a problem with a Bag instance.
 
When execute this code :
 
initialize
 
    bag:= Bag new.
 
    bag add: 'Dario'.
    bag add: 'Dario'.
    bag add: 'Dario'.
    bag add: 'Dario'.
 
   voceA := Voce new.
    bag add: voceA.
    bag add: voceA.
 
    bag add: Voce new.
 
    ^bag
 
Somtime this code answer  aBag with two element:
 
    Dario-> 4
    aVoce -> 3.
 
Somtime this code answer aBag with three element:
 
     Dario-> 4
    aVoce -> 2.
    aVoce-> 1.
 
The Voce class implement  the method = . It answer true.
 
Any pointers would be greatly appreciated!

Thanks!

Dario
 
 
 


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Bag strange behaviour

keith1y

> The Voce class implement  the method = . It answer true.
>  
> Any pointers would be greatly appreciated!
>
> Thanks!
> Dario
Does the Voce also implement #hash? (see comments on Object #=)

Keith


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki