Why is `opequals` for objects not `@safe` by default?

Jonathan M Davis newsgroup.d at jmdavisprog.com
Fri Apr 5 20:27:45 UTC 2024


On Friday, April 5, 2024 10:02:27 AM MDT H. S. Teoh via Digitalmars-d wrote:
> On Thu, Apr 04, 2024 at 11:56:05PM -0600, Jonathan M Davis via Digitalmars-d
> wrote: [...]
>
> > Ideally, Object wouldn't have functions like opEquals, and they'd only
> > be added by derived classes so that programs could put whatever
> > attributes on them make the most sense, but that's a breaking change,
> > so it hasn't happened.
>
> [...]
>
> We've been talking about ProtoObject for years now. When will that
> materialize?

Ideas have been discussed, but no one ever implemented anything, and I don't
know what the exact issues are with it at this point other than the simple
fact that it requires that someone do the work.

At this point, we'd need a DIP and someone to actually go and implement it,
and it's not something that anyone has chosen to take the time to tackle. It
may end up being easier with Editions, though since we need to support
multiple Editions with the same druntime, there are some things that we'll
never be able to do (e.g. we're pretty sure that we can't ever remove the
monitor from Object, because then the previous Editions would all break due
to binary incompatibilities, though if we have a ProtoObject, then we can
hopefully have a separate hierarchy without the monitor).

So, as is often the case, I think that it's a combination of problems
related to manpower and priorities.

- Jonathan M Davis





More information about the Digitalmars-d mailing list