[Pharo-users] Traits for class methods?

Konrad Hinsen konrad.hinsen at fastmail.net
Wed Feb 13 06:22:34 EST 2019

On 11/02/2019 17:18, Cyril Ferlicot wrote:

> A quick question: is it possible to use traits to define class methods?
>> For example, could the popular singleton pattern consisting of the
>> three class methods #uniqueInstance, #new, and #reset plus the instance
>> variable uniqueInstance be packaged as a trait?
> Hi,
> Yes it is possible.

Thanks for your encouragement!

I ended up trying exactly that example, and it works just fine:



More information about the Pharo-users mailing list