[squeak-dev] Re: Traits in Trunk - how to remove a trait from a class?

Andreas.Raab andreas.raab at gmx.de
Fri Oct 19 08:39:35 UTC 2012

Chris Cunningham wrote
> Is there a way (UI, code) to make a class NOT use any traits after a
> class has a Trait assigned to it?

Try this:

  Trait flattenTraitMethodsInClass: MyClass.

This will flatten all the trait inherited methods in the given class. It
will also create a method #traitInfo which keeps the original information so
the trait could be recreated via:

  Trait restoreCompositionOf: MyClass.

If you don't want to restore the composition, you can just delete the
#traitInfo method.

  - Andreas

View this message in context: http://forum.world.st/Traits-in-Trunk-how-to-remove-a-trait-from-a-class-tp4651899p4651922.html
Sent from the Squeak - Dev mailing list archive at Nabble.com.

More information about the Squeak-dev mailing list