From: Chris Pine Date: 2003-04-24T23:29:06+09:00 Subject: Re: Subject: Re: [ANN] Ruby.shop ----- Original Message ----- From: "Hal E. Fulton" Hmmmm. Well, I have always perceived some circularity in Ruby's object model, and I guess I wanted to see an explicit loop in the drawing. ---------------------------- Properly understood, there isn't a loop in the `class', `superclass', or `metaclass' relationships; it's confusing, but you want your poster to *eliminate* that confusion. The `kind_of?' relationship has loops all over the place, but it is also a one-to-many relationship, so it's hard to draw those arrows. However, a picture with class and superclass relationships clearly drawn makes figuring out `kind_of?' easy. However, I agree with Dave; leave out the class and metaclass arrows. There's only so much you can do with one picture. ---------------------------- I guess this perception can be said to stem from the fact that classes are objects. If you came from C++ and Java, as I did, you can see this would seem esoteric. ---------------------------- Yep, it sure is easy when the sets of objects and classes are disjoint! (Plus, no metaclasses.) In that case, even though the relationships are still just as different as in Ruby, you can relax about it because everyone has only one arrow, anyway; what difference the color? ---------------------------- Apparently the loop in Matz's original drawing shows that the circularity is not entirely in my head... but can I omit the singleton classes and still depict that loop? ---------------------------- (I'm going to assume there's a method `metaclass' which will return a class's metaclass; it's singleton class.) There are two paths from Object to Class: Object.class == Class Object.metaclass.superclass == Class These are totally different; in any case, since you are showing `superclass' everywhere else (which is also what goes on behind the scenes when you include a module into a class), I would say stick with that. After all: Object.superclass != Class And metaclass is *not* the same as superclass. Aside from the very messy, one-to-many relationship if `kind_of?', there is only one loop which exists for any of the relationships is this one for the `class' relationship: Class.class == Class I don't think you need a loop in your picture, because there really isn't one. Chris