From: Robert Klemme Date: 2010-08-23T23:17:18+09:00 Subject: Re: === is not a symmetric operator? 2010/8/23 Ralph Shnelvar : > Is my understanding correct that === is not a symmetric operator?  That, in fact, >  X === x > and >  x === X > > mean different things? Exactly. > - - - - - > irb(main):001:0> class X > irb(main):002:1> end > => nil > irb(main):003:0> x = X.new > => # > irb(main):004:0> x === X > => false   # this is surprising > irb(main):005:0> X === x > => true    # this is the test I want ... but was surprised when >           # x === X didn't work. > irb(main):006:0> > - - - - - > > Does x === X ever mean anything useful? That depends on what objects x and X refer to. Remember that X is only a constant - and not a class or module automatically. Cheers robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/