[squeak-dev] Re: Unload Traits script

Andreas Raab andreas.raab at gmx.de
Mon May 12 17:39:32 UTC 2008


Klaus D. Witzel wrote:
> 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?

Purely convenience. By having the class-side trait being represented as 
the class of the instance trait, the browser doesn't need to be aware of 
it. Not necessarily the most obvious solution but it keeps changes in 
other places very minimal.

Your idea about applying traits is certainly possible but relationship 
between traits and classes is already questionable as far as I am 
concerned. For example, traits without a class trait can be applied to 
meta classes; traits with class traits can not be applied meta classes; 
but once an instance trait is applied to a metaclass one can still add a 
method to its class trait etc. So I'm not in favour of making that any 
more complex than it absolutely has to be; in fact, I'd be in favor of 
abandoning the ability to apply instance traits to metaclasses 
altogether for clarity.

Cheers,
   - Andreas

>> 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