ProtoObject and comparison for equality and ordering

Adam D. Ruppe destructionator at gmail.com
Wed May 15 00:32:42 UTC 2019


On Wednesday, 15 May 2019 at 00:19:05 UTC, Andrei Alexandrescu 
wrote:
> I repeat myself: this won't work.
>
> Recall that a < b is lowered into a.opCmp(b) < 0. So we have a 
> comparison against the literal 0.

We could just as well change the definition of the lowering to

a.opCmp(b) == ComparisonResult.lessThan


I understand the generated instructions would be slightly 
different and that might be relevant, but if we're talking about 
changing things, no need to arbitrarily draw the line like that.


More information about the Digitalmars-d mailing list