ProtoObject and comparison for equality and ordering

Dominikus Dittes Scherkl dominikus at scherkl.de
Wed May 15 07:10:44 UTC 2019


On Tuesday, 14 May 2019 at 20:36:08 UTC, Eduard Staniloiu wrote:
> Now the attributes of `opCmp` will be inferred. The implication 
> of this is that now, if we are in the worst case scenario 
> (comparing two `ProtoObject`s) we can not establish any 
> relationship between the two, the `__cmp` lowering won't be 
> able to compare two.
That's ok. Why should anybody expect that two arbitrary things 
should have an ordered relation? Is egg > apple? And in what way? 
Is it heavier? longer? older? better? has more calories?
Stupid.
>
> Since we are here, I want to raise another question:
> Should `opCmp` return a float?
Yes, please!
I need unordered relations so often (see above)!



More information about the Digitalmars-d mailing list