From: Gary Wright Date: 2010-06-22T06:52:54+09:00 Subject: Re: Namespacing a class On Jun 21, 2010, at 3:35 PM, Jörg W Mittag wrote: > Eric MSP Veith wrote: >> Modules are used for mixins. Is it possible -- and does it make sense at all >> - -- to mixin a class into another class? I guess not? > > Actually, to add a bit to Brian's answer: it *is* possible and makes > perfect sense. It's just not allowed in Ruby, but it *is* allowed in > other languages. Allowing classes to mixin other classes would change the class hierarchy from a tree to a directed acyclic graph. As soon as you do that you have to figure out how to manage the method lookup process along multiple paths. I don't think there is any sort of consensus on how to do that (i.e. different languages take different approaches) and so I'm not sure 'makes perfect sense' is an accurate characterization of the solution space for that problem. Gary Wright