Should this be correct behaviour?

Janice Caron caron800 at googlemail.com
Thu Nov 29 23:32:09 PST 2007


On Nov 29, 2007 11:32 PM, Derek Parnell <derek at nomail.afraid.org> wrote:
> (1) If (a[n] != b[n]) is true then (a == b) should be false.

I didn't say that (a[n] != b[n]) is true. I said that (a[n] == b[n])
is false. Not the same. In fact, (a[n] == b[n]) and (a[n] != b[n]) are
both false.

So we might suppose that (a == b) and (a != b) should also both be false.


> I'm tending to think that I prefer the existing D behaviour because it
> allows easier generic code for templates and just 'feels' right.

I don't actually have an opinion one way or the other. Both approaches
feel equally right to me. I just wanted to make sure we all understood
the behaviour, and that there was some consensus on which approach is
most sensible.

Sean's analysis is interesting though. His comment "I have no idea why
it does this." is one that I'd like to see answered.



More information about the Digitalmars-d mailing list