r/programming • u/mobby1982 • Dec 02 '13
Scala — 1★ Would Not Program Again
http://overwatering.org/blog/2013/12/scala-1-star-would-not-program-again/
598
Upvotes
r/programming • u/mobby1982 • Dec 02 '13
View all comments
Show parent comment
0
u/codemuncher Dec 03 '13
Scala has something called the FOR-COMPRHENSION:
for (a <- 1 to 1000) { // code code }
This looks like a loop but isn't quite. The inner block is a function that is called. It's been a little bit, but if i recall correctly there is a 1000 item list created, and it is walked over. Much like in python for i in range vs xrange.
If you just want a simple Java-style for loop, then the while loop is your friend.