Re: Confused about class equality

2010-04-07 Thread Justin Spahr-Summers
On Tue, 06 Apr 2010 23:35:01 -0400, strtr st...@spam.com wrote: Justin Spahr-Summers Wrote: Hmm, that is pretty weird. Are you doing any casts anywhere, or any pointer arithmetic/tricks? A search for cast didn't show any related casts. Do you maybe know another thing to check? I do

Re: Confused about class equality

2010-04-06 Thread Justin Spahr-Summers
On Tue, 06 Apr 2010 22:41:43 -0400, strtr st...@spam.com wrote: Justin Spahr-Summers Wrote: I think he said that he has two distinct object references, but the value stored in the object(s) changes by changing either one. In other words, we'd need to see the code. I've added

Re: Confused about class equality

2010-04-06 Thread strtr
Justin Spahr-Summers Wrote: Hmm, that is pretty weird. Are you doing any casts anywhere, or any pointer arithmetic/tricks? A search for cast didn't show any related casts. Do you maybe know another thing to check? I do throw references around and there are a lot of implicit casts to extended

Re: Confused about class equality

2010-04-04 Thread strtr
Ali Çehreli Wrote: The code works as expected with 2.042 I had to modify the toString() functions to return string, and say override in C's toString definition; and had to modify the writefln() calls: writefln(%s : %s %s, i2.toString(), i2.__vptr, i2.__monitor); The output:

Re: Confused about class equality

2010-04-04 Thread bearophile
strtr: Is it possible to have different vpointers/monitors pointing to the same object? I think this questions is meaningless. Those pointers don't point to objects. And the is operator compared class references, not vpointers/monitors. Bye, bearophile

Re: Confused about class equality

2010-04-03 Thread Jacob Carlborg
On 4/3/10 07:03, strtr wrote: What I probably mean to ask is : In the code below, for what kind of i1 and i2 would the output be like this : - Same Value. 3 : 5B536C 59D020 3 : 59CE0C 59CEF0 5 : 5B536C 59D020 5 : 59CE0C 59CEF0 - if( i1 !is null i2 !is null i2.value == i1.value

Re: Confused about class equality

2010-04-03 Thread strtr
Jacob Carlborg Wrote: On 4/3/10 07:03, strtr wrote: What I probably mean to ask is : In the code below, for what kind of i1 and i2 would the output be like this : - Same Value. 3 : 5B536C 59D020 3 : 59CE0C 59CEF0 5 : 5B536C 59D020 5 : 59CE0C 59CEF0 - if( i1

Confused about class equality

2010-04-02 Thread strtr
The program below outputs, as I would expect : Same Value. Same Object. 3 : 44E15C 3 : 44E15C 5 : 44E15C 5 : 44E15C Now what would it mean if it were to output : Same Value. 3 : 5B536C 59D020 3 : 59CE0C 59CEF0 5 : 5B536C 59D020 5 : 59CE0C 59CEF0 (Output from essentially the

Re: Confused about class equality

2010-04-02 Thread strtr
Justin Spahr-Summers Wrote: On Fri, 02 Apr 2010 22:36:40 -0400, strtr st...@spam.com wrote: You may want to try reducing the code within your larger project to the smallest use case where the problem still occurs, because, I agree, the code as written will always result in the same

Re: Confused about class equality

2010-04-02 Thread strtr
What I probably mean to ask is : In the code below, for what kind of i1 and i2 would the output be like this : - Same Value. 3 : 5B536C 59D020 3 : 59CE0C 59CEF0 5 : 5B536C 59D020 5 : 59CE0C 59CEF0 - if( i1 !is null i2 !is null i2.value == i1.value ) { writefln(Same