D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 9770 - Remove opCmp from Object
Summary: Remove opCmp from Object
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: druntime (show other issues)
Version: D2
Hardware: All All
: P4 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks: 1824
  Show dependency treegraph
 
Reported: 2013-03-21 00:03 UTC by Jonathan M Davis
Modified: 2024-12-07 13:32 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Jonathan M Davis 2013-03-21 00:03:15 UTC
Per this thread http://forum.dlang.org/post/jtlj1k$1fdj$1@digitalmars.com , it was decided to try and go the path of removing opEquals, opCmp, toHash, and toString from Object, as they don't need to be there, and the fact that they're there is causing issues with attributes such as const ( issue# 1824 ).

This issue is specifically for opCmp so that any work towards making it unnecessary and removing it can be referenced here, whereas the other 3 have separate bugzilla entries, as the work for them isn't necessarily related to each other. opEquals, opCmp, and toHash in particular may require substantial work to be done on the built-in AAs before they can actually be removed from Object, as the AA implementation is not currently templated like it should be.
Comment 1 Jonathan M Davis 2013-03-21 00:05:48 UTC
Related:

opEquals: issue# 9769
toHash: issue# 9771
toString: issue# 9772
Comment 2 Jonathan M Davis 2013-10-13 16:17:23 UTC
Relevant discussion on how to transition away from having these functions on Object (the thread got broken up a bit - probably by the mailman bug):

http://forum.dlang.org/post/mailman.214.1369617617.13711.digitalmars-d@puremagic.com
http://forum.dlang.org/post/mailman.280.1369712394.13711.digitalmars-d@puremagic.com

The key suggestion is to change the compiler so that those 4 functions can be free functions in object_.d, similar to how the compiler already does special stuff for == rather than simply calling Object's opEquals.
Comment 3 dlangBugzillaToGithub 2024-12-07 13:32:27 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/17120

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB