R
Ralph Shnelvar
[Note: parts of this message were removed to make it a legal post.]
Is my understanding correct that === is not a symmetric operator? That, in fact,
X === x
and
x === X
mean different things?
- - - - -
irb(main):001:0> class X
irb(main):002:1> end
=> nil
irb(main):003:0> x = X.new
=> #<X:0x4d3a660>
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?
Is my understanding correct that === is not a symmetric operator? That, in fact,
X === x
and
x === X
mean different things?
- - - - -
irb(main):001:0> class X
irb(main):002:1> end
=> nil
irb(main):003:0> x = X.new
=> #<X:0x4d3a660>
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?