From: 7stud -- Date: 2011-08-24T15:05:58+09:00 Subject: Re: Gritty Details of super() luke gruber wrote in post #1018148: >>Therefore, your statement here: > > ---mine >> the anonymous superclass that >> proxies the module (ASCTPTM...hehe) >> does not proxy the singleton methods of the module. > ---mine (Luke) > >>is non-sensical because a regular class (or an anonymous class) never >>contains the singleton methods. > >>7stud > > Right, what I should have said, and what I really meant (that's my story > and I'm sticking to it...) is that the ... ASCTPTM ... has a singleton > class, and that singleton class doesn't proxy the included module's > singleton class for some unknown reason. Maybe it's because anonymous > classes can't have singleton classes after all. Who knows about the > implementation, Up higher somewhere, I posted this example: ==== The question is what happens to the singleton methods in the module, which are defined like this: module M M.greet puts 'MMMM' end end ?? Does ruby create a second class #M to contain the singleton methods? Let's test that: module M def M.greet puts 'MMMM' end def test M.greet end end class Dog include M end d = Dog.new d.test --output:-- MMMM So ruby does create #M because you can call the singleton methods. However, ruby does not insert #M into the singleton hierarchy in the lookup diagram. ==== -- Posted via http://www.ruby-forum.com/.