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

Tracking issue for the cmp::Reverse type #40893

Closed
mitsuhiko opened this Issue Mar 29, 2017 · 13 comments

Comments

Projects
None yet
6 participants
@mitsuhiko
Copy link
Contributor

mitsuhiko commented Mar 29, 2017

Added in #40720 under the reverse_cmp_key feature flag.

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented May 11, 2017

@rfcbot fcp merge

Seems like a nifty feature to stabilize!

@rfcbot

This comment has been minimized.

Copy link

rfcbot commented May 11, 2017

Team member @alexcrichton has proposed to merge this. The next step is review by the rest of the tagged teams:

Concerns:

Once these reviewers reach consensus, this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@dtolnay

This comment has been minimized.

Copy link
Member

dtolnay commented May 11, 2017

I think a wrapper type makes sense by analogy with std::num::Wrapping. 👍

Elsewhere in std we call this "rev" instead of "reverse". 👎

I see the iter module mentioned in the PR but not the Rev type so it doesn't seem like this was discussed. Does it make more sense to call this std::cmp::Rev?

@rfcbot concern rev

@BurntSushi

This comment has been minimized.

Copy link
Member

BurntSushi commented May 11, 2017

@dtolnay Slices have a reverse method. :-)

@dtolnay

This comment has been minimized.

Copy link
Member

dtolnay commented May 11, 2017

Well shucks.

Comparing by conceptual similarity, I think this feature has more in common with std::iter::Rev than with slice reverse. They mean "don't do anything, but the next thing I ask you to do, do it backwards."

FWIW I think Reverse is a better name.

@BurntSushi

This comment has been minimized.

Copy link
Member

BurntSushi commented May 12, 2017

FWIW I think Reverse is a better name.

Me too. Given we already have the inconsistency, I think that pushes me toward Reverse.

@dtolnay

This comment has been minimized.

Copy link
Member

dtolnay commented May 12, 2017

With a clean slate, would we call them Iterator::reverse and std::iter::Reverse?

  • If so, is there somewhere we should be tracking this so that when the AI overlords invent a way to version std, they can follow up?
  • If not, is there any way to rationalize the difference?
@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented May 12, 2017

I feel like we discussed Iterator::rev vs Iterator::reverse a long time ago, but that was like pre-1.0 days. I always find it hard to drag up these rationales after-the-fact. (e.g. why std::iter and not std::iterator?)

@mitsuhiko

This comment has been minimized.

Copy link
Contributor Author

mitsuhiko commented May 12, 2017

FWIW the Python model has traditionally been "short names for modules" and "long descriptive names for methods" which is also what seems to be followed generally in Rust now. It does feel like rev() is one of the few exceptions to that rule.

@dtolnay

This comment has been minimized.

Copy link
Member

dtolnay commented May 17, 2017

Reverse is a better name.

@rfcbot resolved rev

@rfcbot

This comment has been minimized.

Copy link

rfcbot commented May 23, 2017

🔔 This is now entering its final comment period, as per the review above. 🔔

@scottmcm

This comment has been minimized.

Copy link
Member

scottmcm commented May 24, 2017

There's also the Ordering::reverse method, so the struct version of that being Reverse seems logical 👍

@rfcbot

This comment has been minimized.

Copy link

rfcbot commented Jun 2, 2017

The final comment period is now complete.

sfackler added a commit to sfackler/rust that referenced this issue Jun 16, 2017

sfackler added a commit to sfackler/rust that referenced this issue Jun 19, 2017

sfackler added a commit to sfackler/rust that referenced this issue Jun 20, 2017

@bors bors closed this in 05cbdb1 Jun 28, 2017

brson added a commit to brson/rust that referenced this issue Jul 8, 2017

alexcrichton added a commit to brson/rust that referenced this issue Jul 13, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.