[Pharo-project] Smells looking at collections

Stéphane Ducasse stephane.ducasse at inria.fr
Sat Oct 23 12:15:01 EDT 2010

> There was a discussion here a few weeks ago concerning a Trait I proposed called TComparable. It is the protocol of Magnitude bundled separately as a Trait, so any class can behave like Magnitude without having to inherit from Magnitude or use composition. You need only add "uses: TComparable" to the class template and then override its abstract methods as needed, and instances of your class will now be comparable. Association could use TComparable rather than inheriting from Magnitude, and, if the build system permits, Magnitude itself could be rewritten to use TComparable. Stef. approved of the idea and expressed a desire to see it in upcoming versions of Pharo, but I am not sure what the current status is.
> That's a nice solution, but it means that Traits have to be in the Kernel. I have three problems with Traits:
> 1) they are stateless
> 2) they are different from classes
> 3) incomplete tools support (this may be fixed in Pharo, but I doubt it is)

1) we build some code to see if we really need state and this is not that obvious and adding state is not trivial
2) well, this is difficult to get the money for the butter and the butter - we are trying.
3) again if nobody does anything and we just all cry on ourselves then nothing will happen.

So for now identifying traits and learning is the way. Then we can refactor, redesign 

More information about the Pharo-dev mailing list