I find myself writing code like this when I want to repeat some execution n times:
for (i <- 1 to n) { doSomething() }
I\'m looking for
The Range class has a foreach method on it that I think is just what you need. For example, this:
0.to(5).foreach(println(_))
produced
0 1 2 3 4 5