Traits approaching mainstream Squeak

Tom Phoenix rootbeer at redcat.com
Tue Aug 30 00:23:26 UTC 2005


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