An array should be an iterable expression
Open
dslx
enhancement
- Dominant language
- C++
- Stars
- 1.9k
- Forks
- 283
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 135
Description
Right now, only `range` and `enumerate` produce an iterable expression (according to the DSLX reference). An array should also produce an iterable expression. We would have this blueprint:
```
for (array_value, accumulator): (type-of-element_of_some_array, type-of-accumulator) in some_array {
body-expression
} (initial-accumulator-value)
```
I assume this could build on the existing support for `enumerate`, and discard the part that produces the indices of the array.
----
Extension: bit slices also strike me as something iterable (but for now, I'm more in need of the array support).
Contributor guide
Assessment
This issue has not been assessed yet.