From: David Naseby Date: 2005-05-05T06:43:35+09:00 Subject: Re: traits (the other ones) vs. mixins On 5/5/05, Joel VanderWerf wrote: > 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. > > They do; as I have (partially) written up on http://homepages.ihug.com.au/~naseby/33.html Traits are mixins, just exceedingly polite ones. -- David Naseby http://homepages.ihug.com.au/~naseby/