-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rename std::num::Zero
and std::num::One
#13699
Comments
Is there any objection? If not, I"ll submit a PR to rename them. |
I personally favor the names Zero and One over AddIdentity and MulIdentity. |
I have no interest in this renaming. In mathematics, the additive/multiplicative identity is very often called 0 and 1, even for things that aren"t conventionally "numbers", e.g. vector spaces and groups. |
@alexcrichton How about we move |
What is the impetus for this renaming? Is it because the words zero and one are ambiguous? |
Because it is Add/Mul Identity, not is number 0/1. Although it"s very often "called" zero/one, but it not "is". |
This kind of change would go through the RFC process today. Please open one if you"re interested in persuing this change! |
I wanted to "Add my reaction" to your post, but I cannot say whether it should be 😕 or 😄 ^^ |
Implement location link for type inlay hints fix rust-lang#11701 This actually doesn"t work due a problem in vscode: microsoft/vscode#167564
std::num::Zero
means neither "the number 0"(noun) nor "zero a value"(verb).std::num::One
does not means "the number 1" (or once).They are both ambiguous and confusing. There are many comments here:
https://mail.mozilla.org/pipermail/rust-dev/2014-April/009432.html
std::num::Zero
should be renamed tostd::num::AddIdentity
,std::num::One
should be renamed tostd::num::MulIdentity
,to match their original meanings.
(Or put them in a separate module:
std::num::identity::{Zero, One}
.)(Or we remove them entirely from std.)
The text was updated successfully, but these errors were encountered: