[squeak-dev] Re: Unload Traits script

Klaus D. Witzel klaus.witzel at cobss.com
Mon May 12 15:54:23 UTC 2008


On Mon, 12 May 2008 14:57:22 +0200, Andreas Raab wrote:

> Philippe Marschall wrote:
>>>  It gives you an image, a) without traits, and b) with the old class  
>>> format.
>>>
>>>  The aim being to 1) enable folks with code that relies on the old  
>>> format to
>>> move up to 3.10 should they so desire 2) Satisfy those who dont like  
>>> the
>>> existing traits based traits implementation and would like to have  
>>> something
>>> simpler and 3) Provide a starting point for a future simpler traits
>>> implementation if anyone wants to write it.
>>
>> What about people who need traits?
>
> There is no reason why a traits implementation needs to be as intrusive
> as this one. Earlier this year I had been playing with a traits
> implementation for Croquet just to understand some of the implementation
> aspects a little better and it was pretty clear that an alternative
> implementation which is much less invasive is not only trivial to do but
> fits much better into the rest of the existing system. I'm attaching a
> draft version of this experiment (which is not fully functional since I
> lost interest but it will load into Croquet and is enough to play with
> it) and you can check it out to see how it hooks into the system -
> basically traits inherit from ClassDescription which avoids most of the
> code duplication and leaves the option for perhaps having stateful
> traits at some point.

Interesting. What would be class Metatrait about (you do new new to it),  
other than for the browser's convenience? Would it make possible to apply  
the same traits to a) the instance side of class A and b) the class side  
of class B?

> The extension points to the existing kernel are
> few (and could be made fewer) and loading and unloading would be trivial
> with just a tiny bit more work.
>
> In any case, this is not a complete implementation but rather an
> illustration that the current implementation isn't the only way traits
> can be implemented in Squeak and that an alternative can be small,
> loadable, and easy to understand.
>
> Cheers,
>    - Andreas





More information about the Squeak-dev mailing list