-
-
Notifications
You must be signed in to change notification settings - Fork 297
Add compile-time @range
and runtime range
/trange
#2392
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
base: master
Are you sure you want to change the base?
Conversation
This seems to overlap a bit with math::iota ? |
There is overlap for sure, but only where the desired array is sequential, from zero, and bound to a type's width; like However, the sequence of numbers produced by |
Fixed merge conflicts. Added the ability to specify the resulting array's type, so it can be more flexible as needed. Also introduced a few more related unit tests. This will now be marked ready for review, provided all CI checks pass. |
You could extend this to be usable with any type supporting + / and comparison. Using |
Ping! |
@lerno I still plan on making your suggested changes! This fell by the wayside thanks to an extended vacation, but I'm working on catching up mentally to any language changes since my absence. Please give this another week or so for an update with your changes to appear (hopefully less), thanks. 🙏 |
This pull request depends on changes from #2378 -- that PR should be merged before this one. I will fix merge conflicts.
Adds a compile-time and runtime
range
functionality, similar to python's range function.Compile-time ranges are fun to splat with: