From: transfire@... Date: 2006-06-12T01:23:18+09:00 Subject: Re: Why the lack of mixing-in support for Class methods? Daniel Schierbeck wrote: > transfire@gmail.com wrote: > > BTW, Daniel, have a look as Facets' classmethods.rb or class_inherit.rb > > for a better idea of how to do what you are suggesting. > > Actually, that solution seems overly complicated -- that may be for > performance reasons, but if we were to disregard those (as we have a > tendency to do,) I like my solution better. I'm not sure if you understand the important difference though --it's not just a differnce in coding, but in actuall functionality. Your approach has a side effect you might not have considered. You see you're evaluating the code directly into the base class/module. In effect you copy the methods rather than include/extend. What happens is that if you were to define the same method in your class, you would over-write it completely. You could not use #super to "call-up" to the module version. In other words your approach might seem less complicate and thus more elegant, but it actually thwarts the use of "inheritance". T.