>    Class
>      |
> A-Singleton -> A
>                |
>           a-singleton -> a
> 
> If vertical means inheritence, and horizontal means "instance of".

Now it is a bit clearer.

> def a.xN(N)
>     return @x if N < 1
> 
>     cls = self
> 
>     N.times do
>        cls = class << cls; self; end
>     end
> 
>     cls.class_eval { @x }
> end

This is weird. :-)  What a language... :)

If I write

class A
end
a=A.new

class << a
# now self is a-singleton, which is child of A?
self.inspect # returns: "A"
end

class A
# now self is A?
self.inspect # returns: "A"
end

This is truly not the same A, isn't it?

So, it is getting clearer, I am starting to learn what
class << self means...

Thanks for the lesson:
Circum