Post #630249
2026-03-05 22:03 UTC
A programming language thing I've been pondering a lot lately, and I hope some smarter people here can explain it to me 🙂 Why is it that pretty much no(?) popular language allows easily traversing more than one sequence in the same loop? I.e.
```
for item in list1, list2, list3 {
# do something with item
}
```
Concatenating the lists is a waste of resources when the result has no other purpose than the traversal. Languages that have "streams" or "yield" can most likely accomplish this without creating an intermediate collection, but often with some additional overhead. But why not using ordinary / simple loop constructs?
Replies (0)
No replies.