[squeak-dev] Re: Unload Traits script

Andreas Raab andreas.raab at gmx.de
Mon May 12 12:57:22 UTC 2008


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. 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Traits-Kernel.2.cs
Type: text/x-csharp
Size: 47792 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20080512/7cd8aa09/Traits-Kernel.2.bin


More information about the Squeak-dev mailing list