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

[stdlib] Add vectorized Span iterator #3852

Closed
wants to merge 7 commits into from

Conversation

martinvuyk
Copy link
Contributor

@martinvuyk martinvuyk commented Dec 9, 2024

Add vectorized Span iterator

Examples:

var iterator = iter(Span(List[UInt8](1, 2, 3, 4, 5, 6, 7, 8, 9, 10)))
var has_a_10 = False

for v in iterator.vectorized():
    has_a_10 |= any(v == 10)

for s in iterator:
    has_a_10 |= s[] == 10

print(has_a_10) # True

Signed-off-by: martinvuyk <martin.vuyklop@gmail.com>
@martinvuyk martinvuyk requested a review from a team as a code owner December 9, 2024 23:45
Signed-off-by: martinvuyk <martin.vuyklop@gmail.com>
Signed-off-by: martinvuyk <martin.vuyklop@gmail.com>
Signed-off-by: martinvuyk <martin.vuyklop@gmail.com>
Signed-off-by: martinvuyk <martin.vuyklop@gmail.com>
Signed-off-by: martinvuyk <martin.vuyklop@gmail.com>
@martinvuyk
Copy link
Contributor Author

I think this might be better as a List[T1].map(func: fn (T1) -> T2) -> Iterator[T2] API

@martinvuyk martinvuyk closed this Dec 15, 2024
@martinvuyk martinvuyk deleted the add-spaniter-vectors branch December 15, 2024 15:43
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.

1 participant