From: Mike Stok Date: 2006-03-23T13:08:14+09:00 Subject: Re: what on earth.. On 22-Mar-06, at 10:44 PM, Timothy Bennett wrote: > Ok, this is off the original track of discussion a bit, but I > wanted to bring this up. > > irb(main):007:0> 5 === Fixnum > => false > irb(main):008:0> Fixnum === 5 > => true > > irb(main):001:0> 5.class === Class > => false > irb(main):002:0> Class === 5.class > => true > > I understand why this is happening (I think). I just think this > needs to be fixed. Or is there a reason why === should not be > commutative? I think of it more as a relationship which has "direction", so in my view there's nothing to be fixed. In the class comparison it's testing whether the class of the operand is the same as _or an ancestor of_ the receiver. So it's not plain same as. (wording taken from the Pickaxe book) Mike -- Mike Stok http://www.stok.ca/~mike/ The "`Stok' disclaimers" apply.