[Newbies] fromClass: including Traits in Squeak 3.9g ?

stephane ducasse stephane.ducasse at free.fr
Sun Nov 19 21:45:37 UTC 2006


> TTrait named: #TPoint
> fromClass: Point
> includeSuperUnit: nil
> uses: {}
> category: 'Traits-Temp'
>
> The authors say "When generating a trait from an existing class,  
> the system automatically replaces instance variable accesses  
> through accessor methods."
> Moreover they say the class serves as a source.

I'm one of the authors and this features was experimental and since  
adrian rewrote entirely traits to have them
much better implemented we did not provide that functionality but it  
should be easy to reimplement with a bit of metaprog magic.
But we will not do it because too busy.

> Exactly the same thing I would like to do in Squeak 3.9final, too.
> But I don't know how to do it.
> If the people, who are doing the research on Traits, included this  
> functionality in March 2003, why isn't there in 2006 ?

Because in march 2003 we were brainstorming and nathanael hacked and  
pacthed squeak to make traits worked. and in 2006
everything was reimplemented and this is much better. :)

Stef




More information about the Beginners mailing list