Equality of Recursive Structures [Was: Closure Compiler in 3.9?]

sig siguctua at gmail.com
Sat May 12 07:44:25 UTC 2007


On 12/05/07, J J <azreal1977 at hotmail.com> wrote:
> But then how do you differentiate an Association that appears in multiple
> different places with several Associations that simply have the same keys?
>
If you need this, you can always rely on identity.
a = b ifTrue: [  a == b ifTrue: [] ]
or
a value = b value

A value in Association must not take a part in comparison operations,
its just a placeholder for storing something under given key. If you
using a comparison in association based on both key and value, then
you losing a sence in having such class at all. Because then it can be
replaced with any other, like Point or Array [2].


>
> >From: "Lukas Renggli" <renggli at gmail.com>
> >Reply-To: The general-purpose Squeak developers
> >list<squeak-dev at lists.squeakfoundation.org>
> >To: "The general-purpose Squeak developers
> >list"<squeak-dev at lists.squeakfoundation.org>
> >Subject: Re: Equality of Recursive Structures [Was: Closure Compiler in
> >3.9?]
> >Date: Fri, 11 May 2007 21:10:46 +0200
> >
> >>Cue another long discussion about hashing.
> >>
> >>Just what do you believe the hash value should be based on?
> >
> >What about the key only?
> >
> >I quickly had a look at some other Smalltalk implementations (VW,
> >Dolphin, Ambrai) they all use the key for hashing only.
> >
> >Lukas
> >
> >--
> >Lukas Renggli
> >http://www.lukas-renggli.ch
> >
>
> _________________________________________________________________
> Catch suspicious messages before you open them—with Windows Live Hotmail.
> http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_protection_0507
>
>
>



More information about the Squeak-dev mailing list