Skip to content
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

Closed
liigo opened this issue Apr 23, 2014 · 9 comments
Closed

rename std::num::Zero and std::num::One #13699

liigo opened this issue Apr 23, 2014 · 9 comments

Comments

@liigo
Copy link
Contributor

liigo commented Apr 23, 2014

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 to std::num::AddIdentity,
std::num::One should be renamed to std::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.)

@liigo
Copy link
Contributor Author

liigo commented Jun 3, 2014

Is there any objection? If not, I"ll submit a PR to rename them.
@alexcrichton @huonw

@alexcrichton
Copy link
Member

I personally favor the names Zero and One over AddIdentity and MulIdentity.

@huonw
Copy link
Member

huonw commented Jun 3, 2014

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.

@liigo
Copy link
Contributor Author

liigo commented Jun 3, 2014

@alexcrichton How about we move Zero and One to submodule std::num::identity? In this way, we still call it Zero and One, but also decrease ambiguous.

@alexcrichton
Copy link
Member

What is the impetus for this renaming? Is it because the words zero and one are ambiguous?

@liigo
Copy link
Contributor Author

liigo commented Jun 3, 2014

Because it is Add/Mul Identity, not is number 0/1. Although it"s very often "called" zero/one, but it not "is".

@steveklabnik
Copy link
Member

This kind of change would go through the RFC process today. Please open one if you"re interested in persuing this change!

@liigo
Copy link
Contributor Author

liigo commented Jul 28, 2016

For ones who comes here:
At the end, Zero and One was deprecated since 1.11, with a reason "no longer used", in #34530. Jun, 2016.
It takes over a year to make decisions about them. CC #27739.

@matt2xu
Copy link

matt2xu commented Jul 28, 2016

It takes over a year to make decisions about them.

I wanted to "Add my reaction" to your post, but I cannot say whether it should be 😕 or 😄 ^^

arcnmx pushed a commit to arcnmx/rust that referenced this issue Jan 9, 2023
Implement location link for type inlay hints

fix rust-lang#11701

This actually doesn"t work due a problem in vscode: microsoft/vscode#167564
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants