+5  A: 

Off the top of my head the only way I can see to pull this off would be to use a Dictionary object (you'd probably want to enable weak keys to avoid any side effects) and then just take the objects as you create them and use them as a key to an incrementing ID counter. Then you could simply look to see if two objects existed as a keys in the Dictionary and if so compare the values stored there.

Branden Hall
ah, yea – that's not a bad idea. Thanks!
David Wolever
A: 

AFAIK there is no way to get to the value that the debugger shows you at runtime.

Total shot in the dark but I think you can use the === comparison to determine if two objects are the same object (in contrast to == that compares the values of the objects). But I could be totally wrong on that.

James Ward
It's true that '===' will compare the identity of two objects… But that won't help me much here (unless I keep a reference to every object, then…)
David Wolever
@David: If you don't have a reference to every object than how are you accessing your objects? If you don't have references to your objects, they will be garbage collected.
Luke
I guess that wasn't clear – there will be references to every instance *somewhere*, but there won't be "one central repository of all my instances".
David Wolever
+3  A: 
Diney Bomfim
hahahha Diney, that is brilliant. Good work.
David Wolever