Asscociation equality (was: Re: When are 2 CompiledMethods = [incl: Float>>nan])

Marcus Denker denker at iam.unibe.ch
Sun Nov 11 14:45:42 UTC 2007


On 12.09.2007, at 23:04, stephane ducasse wrote:

>
>
> Begin forwarded message:
>
>> From: Andreas Raab <andreas.raab at gmx.de>
>> Date: 11 septembre 2007 07:36:56 HAEC
>> To: The general-purpose Squeak developers list <squeak-dev at lists.squeakfoundation.org 
>> >
>> Cc: "The New Compiler, AST, IRBuilder, Closures..." <newcompiler at lists.squeakfoundation.org 
>> >
>> Subject: Asscociation equality (was: Re: When are 2 CompiledMethods  
>> = [incl: Float>>nan])
>> Reply-To: The general-purpose Squeak developers list <squeak-dev at lists.squeakfoundation.org 
>> >
>>
>> Klaus D. Witzel wrote:
>>> on Sun, 09 Sep 2007 11:26:58 +0200, you wrote:
>>>> Revert Association>>= to what it used to be and everything will  
>>>> be fine (Association>>= is really, really badly broken; it causes  
>>>> problems all over the places and this is one of them).
>>> That's a very, very good one, thanks for reminding us of that open  
>>> issue.
>>> Since the compiler machinery (BytecodeGenerator) already uses  
>>> #literalEqual: and I want Decompiler to use the same comparision  
>>> for literals, it'll be easy to put #literalEqual: into Association  
>>> without touching its current #= implementation. In a later step  
>>> it's perhaps possible to really, really revert #= in Association.
>>
>> I only wish I knew *why* this got changed in the first place. Both,  
>> #hash and #= have Marcus' initials on it - can someone perhaps ask  
>> him why that change was needed or desirable? I'm afraid there may  
>> be some non-obvious users of that change but since I can't track  
>> down exactly where this happened I really don't know where to even  
>> start looking.
>>
>>

This change came from the time when I played with AOStA. I ported it  
from VisualWorks, and it uses actually
association as keys in Dictionaries somewhere. (That took a while to  
find why that did not work....). So I changed it in my
development image.

Then I thought that this is stange, to have (1->2) to be equal to (1- 
 >7) and submitted the changeset to
the BFAV bag then. It was reviewed (not by me), and added (not by me)  
and is in the image since 3.7 or 3.8.

And in VisualWorks this is really defined like this:

(1->2) = (1->3)  --> false

= anAssociation
	"Answer whether the receiver is equal to the argument."

	^super = anAssociation and: [self value = anAssociation value]


So I am at leat not completely alone with having thought that this is  
the way it should be.

	Marcus
	



More information about the Squeak-dev mailing list