Traits approaching mainstream Squeak

stéphane ducasse ducasse at iam.unibe.ch
Tue Aug 30 06:34:58 UTC 2005


basically when compiled methods do not contain a super reference they  
are shared between
traits dictionaries and class method dictionaries that use them.
For super, the class is hardcoded in the compiled Method literal  
frame so we have to copy it and change that.

Stef



On 30 août 05, at 02:23, Tom Phoenix wrote:

> On 8/26/05, Daniel Vainsencher <daniel.vainsencher at gmail.com> wrote:
>
>
>> Basically, the main conceptual "gotcha" you need to remember whenever
>> working in a Traits image, is that if you're modifying code in a  
>> class,
>> this code might actually come from a Trait, and thus you might  
>> actually
>> want to change it there instead. If you don't know this (for example
>> because the tool hasn't been updated yet, and doesn't show you the
>> method comes from a trait, and you don't check yourself), then you'll
>> duplicate the code when you modify it.
>>
>
> I'm trying to understand what's really going on "under the hood" when
> a class uses traits.
>
> It seems that the methods in a trait are compiled there, but then used
> in more than one place. That is, a particular instance of
> CompiledMethod could appear in more than one method dictionary only if
> the method is defined in a trait. (And that never happens in
> pre-Traits Squeak.) Is that right?
>
> --Tom Phoenix
>
>
>




More information about the Squeak-dev mailing list