Logan Capaldo wrote: > > On Jun 12, 2006, at 12:04 PM, Daniel Schierbeck wrote: > >> Logan Capaldo wrote: >>> On Jun 12, 2006, at 5:09 AM, Daniel Schierbeck wrote: >>>> I'm wondering why it's not possible to #include a class into a >>>> module/class -- making the only difference between classes and >>>> modules the ability to instantiate (#allocate). That way, you could >>>> do something like this: >>>> >>>> class Module >>>> def included(mod) >>>> mod.extend(class << self; self; end) >>>> end >>>> end >>>> >>>> i.e. extend the receiver with the methods and constants of the >>>> singleton class. It sure would make this whole problem a lot easier >>>> to solve, and avoid those pesky hacks we're all but fond of. >>> Then you have multiple inheritance. >> >> Yes. >> > > That's why it's not possible. matz. has strong feelings about MI. I'm not saying we should add it to core -- but I don't understand why we shouldn't allow people to do it themselves. If it was possible to include classes into modules/classes, it would still just be the instance methods and constants of the included class -- so it isn't full inheritance. If the coder overwrites Module#included, full inheritance can be achieved. I don't think it should be up to us whether or not we will allow people to do that. I'm sorry if I don't make much sense right now, I'm a bit drunk (sorry). Cheers, Daniel