>>>>> "F" == Florian G Pflug <fgp / phlo.org> writes:

F> class Foo
F> end

F> bar = Foo.new

F> bar_singleton = class << bar
F> 	self
F> end

F> than bar_singleton will be an instance of class Class (and the superclass of

 Yes, bar_singleton is an instance of Class, and this is a singleton class

F> bar_singleton is Foo, altough due to the hiding of singleton classes, 
F> bar_singleton.superclass will tell return "Object").

 no, #superclass don't hide singleton classes, it just hide included
 classes.

 Like you've said the superclass of bar_singleton is Foo, this mean that
 bar_singleton.superclass will return Foo

 This is #class which hyde singleton classes and included classes

 For example in your example, the class of bar is bar_singleton, but
 if you ask bar.class it will reply Foo


F> and therefore

F> Foo_singleton = Foo_class << Foo
F> 	self
F> end

F> will make Foo_singleton an instance of the "class of class Class" - and
F> therefore an instance of the metaclass of Foo.

 Foo_singleton is the metaclass of Foo.

F> And the instance method "instance_methods" of the
F> _metaclass_ gives me the class methods,

 yes,


Guy Decoux