Traits - does a trait trigger any callback when used on a class?

Tom Phoenix rootbeer at redcat.com
Tue Jan 8 22:31:26 UTC 2008


On Jan 8, 2008 1:16 PM, itsme213 <itsme213 at hotmail.com> wrote:
> "Tom Phoenix" <rootbeer at redcat.com> wrote in message
> > Or do you mean that you want to do something when a trait is first
> > applied to a class?
>
> First applied.

You could install a hook somewhere around the time the class is first
instantiated, I suppose. But wouldn't that break some of the rules of
traits, if there's more processing going on than what shows in the
code of the trait itself?

Maybe what you want is to have your trait use a class trait that would
do some initialization?

Good luck with it!

--Tom Phoenix



More information about the Squeak-dev mailing list