More iterator methods (any, all, windows, chunks, take, etc.) #11814
Replies: 4 comments
-
I'm still new to V but I would be happy to work on these features if approved by the community / maintainers. |
Beta Was this translation helpful? Give feedback.
-
Hi @mcastorina yep V embraces FP style and want to hear more about it! I suggest you join V's discord channel (find it on main page). There you can share your idea and have a direct and interactive discussion with community and many dev members. IMO it's an effective way to get approval of a proposal : ) |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Please take into account D's corresponding concept ranges. https://tour.dlang.org/tour/en/basics/ranges A D range is closely related to a Rust iterator but not to a C++ iterator. In D a range is a combination of a C++ begin and end iterator. Like in C++ and Rust ranges are not limited to array operations. They instead return lazy and chainable calculations. D ranges have a couple of powerful concepts not present in most other languages. For instance the return type of Moreover ranges can be queried at compile-time for unboundedness (empty property is always is false). In D such ranges as called infinite ranges or generators. |
Beta Was this translation helpful? Give feedback.
-
filter
andmap
are great but I'd like more iterator methods like the ones mentioned in the title. Rust offers a huge number of functions for anything that is iterable: https://doc.rust-lang.org/std/iter/trait.Iterator.html#provided-methodsThe biggest benefit I see is it allows for a more functional style of programming.
Some example usage:
Beta Was this translation helpful? Give feedback.
All reactions