Joel VanderWerf
5/4/2005 9:37:00 PM
Ara.T.Howard wrote:
...
> - Traits can be composed: trait composition is symmetric and conflicting
> methods are excluded from the composition
...
> i cannot see how this differs from mixins? for example:
The operation of mixing in modules is not commutative.
class C1
include M1
include M2
end
class C2
include M2
include M1
end
C1 and C2 may have radically different behavior. I guess using ruby
modules as traits in this sense would require either some checking in
#module_included, or some global registry of which modules are allowed
to define which methods.