Hi,
In message "[ruby-talk:02036] Anonymous and Singleton Classes"
on 00/03/20, B_DAVISON <Bob.Davison / reuters.com> writes:
|I am a Ruby newbie and having some problems getting my mind around certain
|aspects of classes, especially anonymous classes and singleton classes.
|
|I composed a nice long mail to you all then realised that I should check the
|mail archive first and found the February thread "Singleton Classes". Now I am
|even more confused!
|
|I had just decided that class << obj; ...; end didn't actually create an
|anonymous class (even though FAQ 6.6 says it does) and then matz says that it
|does.
Two points:
(a) `Class::new' should call `inherited' because it creates new
anonymous subclass. It's a bug.
(b) In current implementation singleton class statement creates
internal class, but it is just a virtual class, so that
`inherited' is not called for them. I consder it a feature.
matz.