[squeak-dev] Re: [Pharo-project] Issue 4538 and CompiledMethod equality

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Mon Sep 19 09:27:59 UTC 2011


2011/9/19 Henrik Sperre Johansen <henrik.s.johansen at veloxit.no>:
>
> Nicolas Cellier wrote:
>>
>> And I don't think the example of Henrik is worth :
>> Lets just change it a bit:
>>
>> Object subclass: #SuperFoo.!
>> Object subclass: #Bar.!
>> SuperFoo subclass: #Foo.!
>>
>> SuperFoo compile: 'bar ^1'.
>> Foo compile: 'bar
>>    ^super bar *2'.
>> foo := Foo new.
>> Smalltalk at: #Foo put: Bar.
>> ^foo bar
>>
>> Could you predict the result (will it try to invoke super Bar bar) ?
>> Yes, since the last association is shared, we just broke (foo
>> class>>bar) *for no reason*...
>>
>> Nicolas
>>
> Didn't see this untill now...
> I have to disagree with "for no reason", we broke it for a very /particular/
> reason; the user specifically replaced Foo with Bar.
>
> TBH, I'd rather the system do what I tell it to do, rather than not because
> it is too important for the system to allow me to jeopardize it. My buddy
> Dave agrees.
>

But if you replace Foo with Bar without mutating Foo allInstances,
then you're asking for trouble.
See my second example with Gump.

To me, changing an entry in a SystemDictionary shouldn't modify
existing class Foo, its instances, and their behavior.

Nicolas

> --
> View this message in context: http://forum.world.st/Re-Pharo-project-Issue-4538-and-CompiledMethod-equality-tp3816284p3823249.html
> Sent from the Squeak - Dev mailing list archive at Nabble.com.
>
>



More information about the Squeak-dev mailing list