WAT: opCmp and opEquals woes
Jonathan M Davis via Digitalmars-d
digitalmars-d at puremagic.com
Fri Jul 25 03:09:46 PDT 2014
On Friday, 25 July 2014 at 09:12:11 UTC, Jacob Carlborg wrote:
> On 25/07/14 10:48, Walter Bright wrote:
>> Putting it simply,
>>
>> 1. == uses opEquals. If you don't supply opEquals, the
>> compiler will
>> make one for you.
>>
>> 2. AAs use ==. See rule 1.
>>
>>
>> Easy to understand, easy to explain, easy to document.
>
> It's very hard to use D when it constantly changes and breaks
> code. It's especially annoying reading your comments on reddit
> that we must stop break code. Then a few days later go an break
> code. I really hope no one gets false hopes from those comments.
The _only_ code that would break would be code that's _already_
broken - code that defines opCmp in a way that's inconsistent
with the default opEquals and then doesn't define opEquals. I see
no reason to worry about making sure that we don't break code
that's already broken.
- Jonathan M Davis
More information about the Digitalmars-d
mailing list