irb(main):001:0> class A
irb(main):002:1> end
=> nil
irb(main):003:0> a = A.new
=> #<A:0x8f6dd3c>
irb(main):004:0> a == a
=> true
irb(main):005:0> a == a.clone
=> false
irb(main):006:0> x = "abc"
=> "abc"
irb(main):007:0> x == x
=> true
irb(main):008:0> x == x.clone
=> true
irb(main):009:0> (1..10) == 10
=> false
irb(main):010:0> (1..10) === 10
=> true
- Perl (near as I can tell) doesn't have anything in the way of user-definable comparison, but still has separate operators. Granted, I don't think the separation is related to the reference-vs-value thing---I don't do Perl much, so the semantics confuse me:
It'll be hard to appeal to the authority/popularity of most languages, because equality is a tricky concept with many meanings---whether or not it's specifically the address-vs-value (eq-vs-equal) thing.