8000 std: add Iterator trait by nilscrm · Pull Request #207 · VineLang/vine · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

std: add Iterator trait #207

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

Merged
merged 8 commits into from
Apr 23, 2025
Merged

std: add Iterator trait #207

merged 8 commits into from
Apr 23, 2025

Conversation

nilscrm
Copy link
Contributor
@nilscrm nilscrm commented Apr 22, 2025

Adds an Iterator trait to the standard library to unify iterators over collections.

This will also enable common operations on iterations such as zip or chain and lays the ground work for an eventual support in for loops.

@tjjfvi
Copy link
Member
tjjfvi commented Apr 22, 2025

The Iterator trait looks reasonable to me. I'd prefer not to have an IntoIterator trait at the moment though – not being able to ensure it actually creates an iterator is a bit of an issue, and I'd like to give more thought to what the API should look like.

@nilscrm
Copy link
Contributor Author
nilscrm commented Apr 23, 2025

The Iterator trait looks reasonable to me. I'd prefer not to have an IntoIterator trait at the moment though – not being able to ensure it actually creates an iterator is a bit of an issue, and I'd like to give more thought to what the API should look like.

Fair, I guess using the IntoIterator trait only makes sense in situations where you can actually rely on the fact that the Iter type is actually an iterator anyway.

@nilscrm nilscrm changed the title std: add Iterator & IntoIterator traits std: add Iterator trait Apr 23, 2025
@tjjfvi
Copy link
Member
tjjfvi commented Apr 23, 2025

Also, looks like some of the implementations are named iter and some are named iterator; I don't have a preference, but it should be consistent.

@tjjfvi tjjfvi added this pull request to the merge queue Apr 23, 2025
Merged via the queue into VineLang:main with commit b967b28 Apr 23, 2025
6 checks passed
@nilscrm nilscrm deleted the iterator-trait branch May 3, 2025 10:33
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.

2 participants
0