On Fri, Mar 8, 2013 at 10:32 PM, stephane ducasse
<stephane.ducasse@free.fr> wrote:
Hi guys,
Can anyone give me some pointers on how to create traits dynamically?
you mean with the refactoring engine?
Yes something like it, I am little confused with all ring, rb stuff. But I know that I can build classes, add methods, and see changes (and apply them) using RBNamespace api... it does not seem to work with traits. Some time ago I have spend some time patching the RB thingy to accept trait also... but then I have run into other problems (i don't remember exactly what)... Moreover, it was just hacks to make it work... so I've lost them over time... and I don't like patching every new image that I download with my changes to make It work...
So maybe, I don't use them right... or there are things that should be done... I'm willing to contribute, if it helps.
I know that one argentinian student added support for traits in RB but I never got the time to have a look and integrate it.
cool, maybe we should have a look...
Then again, it is not clear in my head what is the politics of traits and pharo... I know that there were some discussions about them being bad because their methods are copied to classes, not being well integrated.... how exactly do they fit in the big picture (next pharo versions). Can we use them as they are now, or the implementation is likely to change in the near future? -- stateful traits, or something else?�
cheers,
ciprian
I have tried something like:�
model := RBNamespace new.
model defineClass: ('Trait named: #TMyTrait
uses: {}
category: ''My-Tests''').
and I get a DNU: RBAddTraitChange>>superclassName
Cheers,
--
Dr. Ciprian TEODOROV
Ing�nieur�D�veloppement�CAO
t�l : 06 08 54 73 48
mail :�ciprian.teodorov@gmail.com
www.teodorov.ro