Error in ancestor?

Hi –

On Wed, 27 Jun 2007, Robert D. wrote:

On 6/26/07, [email protected] [email protected] wrote:

The thing is, there’s one big difference that’s not just a matter of
implementation: singleton classes of Class objects are the only ones
that can actually be called by more than one object (the class, plus
its descendants).
I am definitely lost here, what do you mean by “can be called”, their
methods of course, ok so that is exactly what I meant, it is the
“outside world” that makes the difference.

I meant the inheritance situation:

class C
def C.x
end
end

class D < C
end

D.x # D calling C’s “singleton” method (which is therefore
# not really singleton, because more than one object can
# execute it).

BTW I wanted just to be sure that this and some other tricks do not
work and they don’t :frowning:
But Ruby threw a “Virtual Class” to me, actually did we discuss this
name?, I quite like it.

I don’t.

(class << “”; self; end).is_a?(Object) # => true

Nothing “virtual” about it :slight_smile:

David