4 ms·
The ergonomics of c style for loops and iterator style loops are totally different. It’s the reason for crates like itertools. I don’t think that is pedantic
by John23832 2y ago
The ergonomics of c style for loops and iterator style loops are totally different.
It’s the reason for crates like itertools.
I don’t think that is pedantic at all.
- dist1ll 2y agoSure, but that's kind of beside the point I was making. The author was contrasting loops - an imperative construct (which both C-style for and iterator-based for are examples of) - to the functional style of chaining iterator functions, adapters & reductions and passing closures around. FWIW I agree with you, it's just that I was trying to make a distinction between imperative and functional style in Rust (just like the author was trying to do) - not literally claiming Rust has C-style for loops.