From: transfire@... Date: 2006-06-14T02:31:00+09:00 Subject: Re: Why the lack of mixing-in support for Class methods? Yukihiro Matsumoto wrote: > I don't think I understand you. Do you want to allow #include to > include classes? Without making it MI? Hmm. No no. You'd still only be able to include modules. I'm thinking a module's "singleton class" could be a "singleton module", so to speak, instead. It's a bit difficult to communicate b/c the terminology is caught up in how it curently works. But it's a lot less fancy than I think it sounds. I'll use a diagram to make it clearer. Lets say we have this code. class Foo include Moo end foo = Foo.new A basic diagram of that currently looks like this: object foo || \/ class foo' -> class Foo -> (vclass Moo) || // \/ module Moo class Foo' || \/ class Moo' I'm thinking that instead it could be like this. object foo || \/ class foo' -> class Foo -> (vclass Moo) || // \/ module Moo class Foo' || \/ (vclass Moo') // module Moo' In this way the so-called "class-level" of a _module_ is instead a "module-level". Essentially: module Moo class << self self.class #=> Module end end Which is why I earlier used "module << self". Of course, in the implmentation you might be able omit the vclass Moo' altogether. I just conceived of it that way becuase it readly "plugs-in" to the current design. T.