From: "David A. Black" Date: 2005-04-20T22:38:29+09:00 Subject: Re: [ANN] Article: Seeing Metaclasses Clearly Hi -- On Wed, 20 Apr 2005, Carlos wrote: > Before your discoveries make you jump into conclusions, you should apply a > little of scientific thought. You have two facts: one, that the diagram > shows that Object --instanceof--> (Object). The other: that > > $ ruby -e 'p Object.instance_of?(class< false > > One possible explanation for this discrepancy is that the diagram is wrong. > Another is that instance_of? doesn't take into account singleton classes. > > I guess it's the second one :). instance_of? tells you (accurately, definitively) whether or not something is an instance of something. Obviously you can draw a diagram that posits any relationship you wish. I could write a diagram that shows Array to be the superclass of String, for example, and claim that #superclass "doesn't take into account" the fact that Array is the superclass of String. But if the diagram isn't actually diagramming Ruby's view of things, then it won't have much value. David -- David A. Black dblack@wobblini.net