[squeak-dev] Re: Issue with traits

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Wed Oct 21 07:39:03 UTC 2009


2009/10/21 Andreas Raab <andreas.raab at gmx.de>:
> Igor Stasenko wrote:
>>
>> Ouch... so VM behavior depends on correct methodClass slot. Thanks for
>> reminding!
>> I remember that methodClass plays important role (and its important to
>> have method and its
>> methodClass being in sync with class where the method installed), but
>> forgot the details :)
>>
>> That could lead to even worse results, if you use super sends, and then
>> in base class , accessing the instance variables in base method. It
>> could corrupt the memory & crash the VM.
>
> Yes, that's why I returned a literal (so the experiment wouldn't crash you
> ;-)
>
>> I hope this is already fixed, because the image where i checked it
>> is quite old one - 3.10.2
>
> I doubt it. Traits are just another abandoned experiment in Squeak.
>

Just tried in Pharo, there is a copy.

(ABBAB methodDict at: #foo) == (ABBAC methodDict at: #foo). -> false

(ABBAB methodDict at: #foo) methodClass. -> ABBAB

At least Traits are maintained there, and pharo changes should be picked.

Nicolas

> Cheers,
>  - Andreas
>
>



More information about the Squeak-dev mailing list