From: "Hal E. Fulton" Date: 2003-04-24T17:43:08+09:00 Subject: Re: Subject: Re: [ANN] Ruby.shop ----- Original Message ----- From: "Chris Pine" To: "ruby-talk ML" Sent: Thursday, April 24, 2003 12:10 AM Subject: Re: Subject: Re: [ANN] Ruby.shop > ---------------------------- > Perhaps the bottom line is that my red > arrows are all backward? > ---------------------------- > > No. Here's what I think about your arrows: > > First, change all blue arrows to red, since they basically mean the same > thing (objects of class A get functionality from class/module B). > > Second, switch your IO --> File arrow to be File --> IO. You just made a > mistake there. > > Third, either get rid of the Object --> Class arrow (since, as you pointed > out, Object does *not* inherit from Class), or change it to a blue line. A > blue line would mean "point to your class". Every class (Object, Module, > and even Class itself) should have a blue line pointing to Class, if you > decide to include blue lines at all; likewise, every module would have a > blue line pointing to Module. This is the *only* line from Object to Class. > Why include it unless you are also including the blue line from Class to > itself? Or from Module to Class? > > I wouldn't suggest putting in the blue lines at all unless you are going to > include some non-class/module objects in the picture; otherwise, all of your > blue lines just point to Class or Module, and it creates a lot of clutter. > But, if you wanted, you could have "hello" --> String and 5 --> Fixnum (both > blue lines, *exactly* like Object --> Class, and totally unlike Fixnum --> > Integer). > > There's a lot of confusion about this, and there doesn't need to be. If you > are going to include a line from Object to Class, *please* consider that > that relationship is *no* different from Module --> Class, or File --> > Class, or Class --> Class. Why include one line and not the others? 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. 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. 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? Hal