Object.toString, toHash, opCmp, opEquals

Jonathan M Davis newsgroup.d at jmdavisprog.com
Thu May 9 07:53:55 UTC 2024


On Wednesday, May 8, 2024 7:20:20 PM MDT Atila Neves via Digitalmars-d wrote:
> On Saturday, 27 April 2024 at 16:35:41 UTC, Paul Backus wrote:
> > 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
>
> I talked to Walter and we agreed that the best way forward is
> probably to deprecate these member functions and remove them in
> the next edition.

Yay!

- Jonathan M Davis





More information about the Digitalmars-d mailing list