help!!
Leandro Caniglia
caniglia at mate.dm.uba.ar
Thu Apr 16 11:23:34 UTC 1998
Mike Klein wrote:
>I wrote: (too quickly)
>
>> hash
>> ^self size
>>
>
>How about: (in Set)
>
>hash
> ^self inject: 0 into: [:answer :each | answer bitXor: each hash]
>
>Yeah, I like that better.
The solution to a #hashING problem should not depend on our taste (like or
dislike), since sometimes it is a non-trivial theoretical problem. So the
question is: is there any definition of the #hash method that is known to be
satisfactory in the general (average) case? When the answer is negative for
a given class, one should avoid using objects of that class as keys in
Dictionaries (or use them with special care).
Saludos,
Leandro
More information about the Squeak-dev
mailing list
|