From: John Mair Date: 2010-10-07T15:35:33+09:00 Subject: Re: Why does Module#include exclude the module's metaclass? @Thomas, I agree, in fact I wrote a little C extension to bring this functionality to modules http://github.com/banister/real_include Use it like this: module M def self.hello puts "hello from class" end def bye puts "bye from instance" end end class A real_include M end A.hello #=> "hello from class" A.new.bye #=> "bye from instance" I would love to hear from Matz himself why this limitation is built in; as most of the explanations i've heard have just been along the lines of "that's not how modules work". In my opinion the current behavior does violate the principle of least surprise. @botp Thanks for the links :) But I don't see how they are on point at all. He's talking there about a 'traits' system, he didn't say *anything* about traits bringing in singleton methods or not. Sorry but i can't see the relevance :( (though maybe i just don't know enough about traits?!) John Thomas Sawyer wrote: > On Oct 6, 7:33�pm, John Mair wrote: >> end >> class A >> >> implementation difficulty (not insurmountable, but one all the same), >> but is this the sole reason? Are there any other reasons for this >> limitation? > > For no good reason other than a purely theoretical misconception > concerning single vs multiple inheritance --at least that's the only > reason I have ever been able to derive from my countless inquiries > I've made into the subject. > > Over the years I have become increasing convinced that the distinction > between class and module in Ruby is simply an artifice that inhibits > the language unduly. -- Posted via http://www.ruby-forum.com/.