Skip to content

make way for a new iter module #6056

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

Closed
wants to merge 1 commit into from
Closed

make way for a new iter module #6056

wants to merge 1 commit into from

Conversation

thestinger
Copy link
Contributor

The existing adaptors like map in the iter module are very flawed because they only work for BaseIter implementations. There are many internal iterator implementations in the standard library like the set methods (difference, symmetric_difference, intersection, union) and the range functions that only share the for loop protocol in common.

The internal iterator adaptors should be implemented to work on any implementation of that protocol, rather than just a method called each taking &self.

This just moves iter.rs to old_iter.rs and begins work on documenting and implementing a nicer module.

@graydon
Copy link
Contributor

graydon commented Apr 25, 2013

I feel ill-equipped to review what's going on in the iteration-protocols area. Do you have a rough plan? Could you write it up somewhere? I realize this sounds foot-draggy but we have reinvented stuff in this space a number of times and I want to make sure we're getting closer-to-done :)

@thestinger
Copy link
Contributor Author

@graydon: I did a write-up of the plan at https://github.com/mozilla/rust/wiki/Iterators

Some of that is included as the docstring in the new iter module.

@graydon
Copy link
Contributor

graydon commented Apr 27, 2013

needs a rebase, sadly. r+ otherwise!

bors added a commit that referenced this pull request Apr 29, 2013
The existing adaptors like `map` in the `iter` module are very flawed because they only work for `BaseIter` implementations. There are many internal iterator implementations in the standard library like the set methods (`difference`, `symmetric_difference`, `intersection`, `union`) and the `range` functions that only share the `for` loop protocol in common.

The internal iterator adaptors should be implemented to work on any implementation of that protocol, rather than just a method called `each` taking `&self`.

This just moves `iter.rs` to `old_iter.rs` and begins work on documenting and implementing a nicer module.
@bors bors closed this Apr 29, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Sep 24, 2020
Add S-* label modifier to triagebot

changelog: none
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

Successfully merging this pull request may close these issues.

3 participants