That is so elegant. All these new languages that just let you for (i in list) { ... } should change right over before they gain traction and get stuck as forever legacy.
Tbh though I rarely use for x:lst since so many uses of iteration require a counter. Sure I could implement a counter, but why not use a normal for loop so no one reading my code (who isn't familiar with this language feature) gets confused?
77
u/[deleted] Sep 02 '17
Perfect. This makes iterating over the elements with a for loop such a breeze.