2 ms·
> with a for loop you could literally mutate anything in scope That depends on the language. In Elixir for instance, you can't mutate anything. Elixir does hav
by rkangel 6y ago
> with a for loop you could literally mutate anything in scope
That depends on the language. In Elixir for instance, you can't mutate anything. Elixir does have 'for comprehensions', and there are things that you can express very clearly in what is effectively a for loop that would be much harder to read in a chain of iterators.
- dnautics 6y agoThat's not strictly true. You could use the process dictionary to keep hidden mutable state in the for loop. Don't do this.