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

add reverse iteration for Cmd #43498

Merged
merged 1 commit into from
Feb 17, 2022
Merged

add reverse iteration for Cmd #43498

merged 1 commit into from
Feb 17, 2022

Conversation

stevengj
Copy link
Member

I noticed in #43497 that Cmd supports iteration but not reverse iteration, which is a minor oversight but is easy to correct so why not?

@stevengj stevengj added the iteration Involves iteration or the iteration protocol label Dec 20, 2021
@stevengj stevengj added the merge me PR is reviewed. Merge when all tests are passing label Jan 24, 2022
@stevengj
Copy link
Member Author

Should be good to merge?

@KristofferC
Copy link
Member

When would you want to do this?

@stevengj
Copy link
Member Author

stevengj commented Jan 24, 2022

The basic principle here is that any iterator should support reverse iteration if possible...it's part of being a full-featured iterator. Here, it's a one-line method, so why not?

@stevengj stevengj removed the merge me PR is reviewed. Merge when all tests are passing label Jan 24, 2022
@ViralBShah
Copy link
Member

Are we holding off on the merge here?

@stevengj
Copy link
Member Author

I don't see any reason not to merge if people don't object.

I agree that this has infinitesimal practical impact, but it's a small patch and it just seems like part of fully implementing iteration, which crops up in various places (e.g. last(itr, n) relies on reversibility).

@ViralBShah ViralBShah merged commit 4930fc9 into master Feb 17, 2022
@ViralBShah ViralBShah deleted the sgj/revcmd branch February 17, 2022 01:06
antoine-levitt pushed a commit to antoine-levitt/julia that referenced this pull request Feb 17, 2022
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Feb 22, 2022
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
iteration Involves iteration or the iteration protocol
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants