<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 26 July 2014 06:35, Walter Bright via Digitalmars-d <span dir="ltr"><<a href="mailto:digitalmars-d@puremagic.com" target="_blank">digitalmars-d@puremagic.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="">On 7/25/2014 5:10 AM, Ary Borenszweig wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Not at all.<br>
<br>
If you have a type that has partial ordering (only cares about opCmp, not about<br>
opEquals), but still keeps the default opEquals, then this would silently break<br>
someone's code by changing their opEquals semantic.<br>
<br>
THIS is the breaking change.<br>
</blockquote>
<br></div>
Yes. A subtle but extremely important point. Comparison and Equality are fundamentally different operations. Defining opEquals to be the equivalent of opCmp==0 is utterly breaking that.<br>
</blockquote></div><br></div><div class="gmail_extra">Perhaps the problem here is that there is a missing concept.</div><div class="gmail_extra">There is equality and equivalence, and only equivalence is expressed in D (ie, the one that is relevant among the suite of comparison operations).</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Would you argue that == and != are unrelated, distinct and separate operations from <,<=,>=,>, and they should never be used in conjunction, or assumed to be related?</div>
<div class="gmail_extra">I think any reasonable person will assume that the suite of comparisons are related operations.</div><div class="gmail_extra">So perhaps === is missing, and that's what should be used for AA's, and also the thing that actually matches the compiler's generated opEquals...?<br>
</div></div>