From: Chris Pine Date: 2003-04-24T07:18:22+09:00 Subject: Re: [ANN] Ruby.shop ----- Original Message ----- From: "Hal E. Fulton" I do think that 'a.class == b' and 'a.is_a? b' mean the same thing, though. (Though you don't mention is_a? above.) And b.superclass==a does *imply* that b.kind_of? a (though the converse is not true). ---------------------------- You should attend my talk if you're going to OSCON! :) First off, `is_a?' is aliased to `kind_of?'. Secondly, this is *not* the same ralationship implied by `class': irb(main):001:0> 5.class == Integer => false irb(main):002:0> 5.kind_of? Integer => true Thirdly, your last statement is false: irb(main):001:0> Fixnum.superclass == Integer => true irb(main):002:0> Fixnum.kind_of? Integer => false In fact, `superclass' and `kind_of?' are fairly loosely related; you can't call `superclass' on any object, like you can with `kind_of?'. Might I make a suggestion? Draw a red line from `a' to `b' if `b' is in `a.ancestors'. (This will make the module lines red, also. Make sure your lines go the right way; File should point to IO, right?) This means no red line from Object to Class; yes, `Object.is_a? Class', but instances of Object don't get any methods from Class. Use blue lines to show the `class' relationship (or, if you prefer, the `is_a?' or `kind_of?' relationship, which is a superset). My point is, there's a big difference between the relationships "Fixnum --> Integer" and "Object --> Class". Chris