In the example of this site, there is a point 3) Generating a trait from a class. http://www.iam.unibe.ch/~schaerli/smalltalk/traits/ traitsPrototype.htm
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.
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 ?
stephane ducasse stephane.ducasse@free.fr wrote:
How can I create a trait from a class in Squeak 3.9 final ?
What do you mean?
If this is taking a class and turning it into a trait. Basically you cannot. It was never the case or I do not understand what you mean.
In previous version I could use e.g. "fromClass: Class1". (http://www.iam.unibe.ch/~schaerli/smalltalk/traits/ traitsPrototype.htm) In 3.9 final this message is not recognized anymore.
Best regards, Warakorn
stephane ducasse wrote: Traits are in 3.9 final.
Stef
On 18 nov. 06, at 01:25, Warakorn Paphrawat wrote:
Hi !
I would like to work with Traits in Squeak 3.9g, too. The current VM and Image run very stabble.
The Traits researcher form Bern provide an image 3.9a where Traits are included. But this image is terribly unstable and I am accustomed now to 3.9g. I want to port the Traits functionality to Squeal 3.9g. How can I do that ?
The thing is, I read that Traits are included in Squeak 3.9g. I can find the Trait classes and categories. But I cannot create Traits...the Browser doesn't recognize the term Trait oder named or fromClass e.g. Trait named: #TsomeTrait fromClass: someClass uses: {something} category: 'some_category'
SqueakMap always complains when I want to install Traits. I read sth. about loading .mcz files, but the FileList Browser doesn't let me to load.
What can I do to make it work ? Sponsored Link
$200,000 mortgage for $660/mo - 30/15 yr fixed, reduce debt, home equity - Click now for info
Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Sponsored Link
Mortgage rates near 39yr lows. $310,000 Mortgage for $999/mo - Calculate new house payment
Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
_______________________________________________ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
--------------------------------- Sponsored Link
Mortgage rates near 39yr lows. $310,000 Mortgage for $999/mo - Calculate new house payment