[rdnzl-devel] C# pointer comparison.

Edi Weitz edi at agharta.de
Tue Mar 25 17:16:09 UTC 2008


On Tue, 25 Mar 2008 17:38:40 +0100, Edi Weitz <edi at agharta.de> wrote:

> I'll probably add the code you submitted to RDNZL anyway as it might
> turn out to be useful in specific cases

But wait.  Looking at this more closely, I see that you're
instantiating the objects (which you could do directly from
DotNetContainer without going through DotNetReference, BTW) and then
comparing them with ==.  Is that the right way to do it?

That's not a rhetorical question.  I don't know the right answer, so
I'd like to discuss it here.  Does == have different semantics from
Equals?

Would it make sense to directly compare the pointers?  (As we already
have Equals "for free", I'm thinking of something like Common Lisp's
EQ - a function which is usually not what you want but which might be
useful if you know what you're doing.)

Comments welcome.



More information about the rdnzl-devel mailing list