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 array_chunks and array_windows? #1012

Open
ronnodas opened this issue Jan 4, 2025 · 0 comments
Open

Add array_chunks and array_windows? #1012

ronnodas opened this issue Jan 4, 2025 · 0 comments

Comments

@ronnodas
Copy link
Contributor

ronnodas commented Jan 4, 2025

Now that next_array exists, it's not so hard to write the methods array_chunks (functionally equivalent to from_fn(|| self.next_array())) and array_windows, similar to the unstable slice::array_chunks and slice::array_windows respectively. However it's similarly unclear what array_chunks<0> and array_windows<0> should do. Does it make sense to emit a post-monomorphization (but still compile-time) error, via say const { assert!(N > 0) }? Or is it better to produce run-time errors?

Is the name arrays preferable to array_chunks, to be consistent with Itertools::tuples?

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

No branches or pull requests

1 participant