How would you expect a programmer to ask "do these two pointers hold the same address?" .holdsSameAddressAs()?
Question: is Mary John?
You want the answer to be "yes" (Mary is John) since the is operator asks whether they hold addresses which have the same value.
But of course it's a broken terminology, because Mary and John are two different people, with their own physical locations etc. So you're overloading a word "is". I get that it works, but so does anything else you make programmers learn.
The same approach could work in imperative or OO languages. For immutable types == should be value equality, while mutable types are analogous to IORef or IOArray, so == should be reference equality. It comes down to observational equality, different instances of the number 2 shouldn't be distinguishable, but different mutable containers with the same contents should be distinguishable because you can make their contents different. I think observational equality is a good fit for pretty much all uses of equality in programming.
assertTrue(mary.getSign == john.getSign)
assertFalse(mary.getSign is john.getSign)
assertFalse(mary == john)
assertFalse(mary is john)this was the OP in this thread:
In Java and C#, you rarely need to ask this question.
In fact, the .NET Framework overloads String, DateTime[0], etc so you can use == for almost all comparisons.
I'd expect a programmer to ask: "is this object the same as this other object" and have the language support that by an operator like `is`. Instead of overloading `==` to mean value and reference equality depending on the context.
However, that terminology is by no means universal. While, from what I can tell, "reference" as defined above is favoured in the Java and C# community, "pointer" is still used plenty. For example, the Java spec says "The reference values (often just references) are pointers to these objects"
All that being said, I do agree with what I think is the spirit of your comment, which is that when your language doesn't allow pointer manipulation it is less useful to ask whether two values point to/reference the same value.
In C++, yes, you do
(&a == &b)
and the plain == is used for the common case of actually doing what you mean (what in Java would be .equals()). (std::addressof(a) == std::addressof(b))
http://en.cppreference.com/w/cpp/memory/addressofI use .equals far more than ==.