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> &lt;
<a href="mailto:oscar.nierstrasz@gmail.com">oscar.nierstrasz@gmail.com</a>&gt; 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&gt;&gt;hash<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;^ 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>&gt; Hi List,<br>&gt;<br>&gt; I have a Class PoolQueue which has instvars &#39;member&#39; and
<br>&gt; &#39;processor&#39;. I find that an instance of PoolQueue when placed in an<br>&gt; OrderedCollection can no longer be considered equal. I suppose I<br>&gt; have to reimplement #= and #hash to allow PoolQueue instances to be
<br>&gt; compared.<br>&gt;<br>&gt; My problem: how do I implement #hash? Or stated another way, what<br>&gt; does #hash accomplish?<br>&gt;<br>&gt; Thanks in advance.<br>&gt;<br>&gt; Ching.<br>&gt; _______________________________________________
<br>&gt; Beginners mailing list<br>&gt; <a href="mailto:Beginners@lists.squeakfoundation.org">Beginners@lists.squeakfoundation.org</a><br>&gt; <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>