Object.toString, toHash, opCmp, opEquals

Paul Backus snarwin at gmail.com
Sat Apr 27 16:35:41 UTC 2024


On Friday, 26 April 2024 at 08:43:46 UTC, Jonathan M Davis wrote:
> The ideal situation here is that none of these functions are on 
> Object at all. They really aren't useful there, because it's 
> not particularly useful or necessary to operate on Object. Some 
> of the druntime code does, because it hasn't been templated 
> yet, but once it has been, it won't need to operate on Object 
> at all. At that point, we won't need to have any of these 
> functions on Object, and Editions should give us the ability to 
> remove them.

+1, this is the correct solution.

We've already had success templating the druntime opEquals 
lowering for classes [1]. We can and should do the same thing for 
the other Object methods.

[1] https://github.com/dlang/druntime/pull/3665


More information about the Digitalmars-d mailing list