Runtime Traits?

stéphane ducasse ducasse at
Mon May 30 20:07:22 UTC 2005

Hi mike

> Hi all, please forgive me if this betrays a terrible level of
> ignorance on my part, but I think there is benefit to be had in
> runtime traits injection, to coin a phrase.  I am writing software
> to enable back testing of stock trading strategies.  Each strategy
> makes use of a selection of technical indicators, and each
> strategies combination of stratgies is usually different.  I am
> writing the technical indicators as traits, which layer over a
> simple Tick class that has open, high, low, close and volume
> accessors to represent the stock data.  I would prefer to inject
> the relevant traits as required by the individual strategy,
> instead of rolling all the traits into one class.

Which traits are you talking? Self traits or Nathanael's one?

This is interesting. Could you show us some code of your current  

> I'd just like to know what others think of traits being a compile
> time thing.

Since now we simply trying to improve reuse with compile time  
(hence traits do not have any semantics at run-time)

> And whether there might be value in mixing them in at
> runtime.  I am also dimly aware of the potential for there being
> little different between compile time and runtime in smalltalk.
> Thanks for listening.

thanks for telling :)
> Mike.

More information about the Squeak-dev mailing list