Hi Oscar,<br><br>Thanks for the help. I tried bitAnd: and it seems to work. I will try bitXor: too. Thanks<br><br>Ching<br><br><div><span class="gmail_quote">On 9/23/07, <b class="gmail_sendername">Oscar Nierstrasz</b> <
<a href="mailto:oscar.nierstrasz@gmail.com">oscar.nierstrasz@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>Hi Ching,<br><br>#hash should be reimplemented to make sure that objects considered to<br>be equal will end up in the same hash bucket.<br><br>The usual trick is to take a bitXor of the hashes of the instance<br>variables:
<br><br>PoolQueue>>hash<br> ^ member hash bitXor: processor hash<br><br>Hope that helps.<br>Oscar<br><br>On Sep 23, 2007, at 9:52, Ching de la Serna wrote:<br><br>> Hi List,<br>><br>> I have a Class PoolQueue which has instvars 'member' and
<br>> 'processor'. I find that an instance of PoolQueue when placed in an<br>> OrderedCollection can no longer be considered equal. I suppose I<br>> have to reimplement #= and #hash to allow PoolQueue instances to be
<br>> compared.<br>><br>> My problem: how do I implement #hash? Or stated another way, what<br>> does #hash accomplish?<br>><br>> Thanks in advance.<br>><br>> Ching.<br>> _______________________________________________
<br>> Beginners mailing list<br>> <a href="mailto:Beginners@lists.squeakfoundation.org">Beginners@lists.squeakfoundation.org</a><br>> <a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners">http://lists.squeakfoundation.org/mailman/listinfo/beginners
</a><br><br>_______________________________________________<br>Beginners mailing list<br><a href="mailto:Beginners@lists.squeakfoundation.org">Beginners@lists.squeakfoundation.org</a><br><a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners">
http://lists.squeakfoundation.org/mailman/listinfo/beginners</a><br></blockquote></div><br>