-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
iter module and ranges #2715
Comments
Fwiw the motivation for this was turning a number N into a vector like ["a0", "a1", ..., "aN-1"]. Code I came up with is:
|
Some info on how ranges and iteration can work together: http://www.informit.com/articles/printerfriendly.aspx?p=1407357 |
Yeah Alexandrescu's range iterators are cool. He gave a good talk on them at Boostcon a few years ago: http://blip.tv/boostcon/boostcon-2009-keynote-2452140 I expect they were influential in the design of iterators in D. I played around with implementing them in C++. I'm not sure if Rust will have the heavy metaprogramming capability that makes them compile-time optimizeable, but that may be true of all types of iterators and generic operations. But they are very powerful and worth looking into. |
There are now composable iterators in the |
I added a |
…t-lang#2885) Improves the error reported to the user when the system kills CBMC to reclaim memory. Resolves rust-lang#2715
The iter module has lots of handy stuff, but afaict there's no built-in way to iterate over numeric ranges. One thing that would be helpful is if, uint at least, had an impl something like
Even better would be a real range type. They seem to be a nice abstraction for collections and algorithms and they would make it simpler to iterate over ranges with non-zero lower bounds.
The text was updated successfully, but these errors were encountered: