4 ms·
> It just feels like I basically never want it to be a copy, but you do frequently want to modify the element you're iterating over. Feels differently to me :)
by Merovius 9y ago
> It just feels like I basically never want it to be a copy, but you do frequently want to modify the element you're iterating over.
Feels differently to me :)
> It actually pushes you to design things in ways you might otherwise not. E.g., instead of []X you'll have []* X just so it'll be easier to modify from inside a loop.
Never do that. Instead I use indexes when I actually want to access the element.
(Where I do do that is in maps, but not because of range, but because index-expressions over maps are not addressable)
- dilap 9y ago> Never do that. Instead I use indexes when I actually want to access the element. Yeah, it's pretty clumsy though.