Since Scala does not have old Java style for loops with index,
for
// does not work val xs = Array(\"first\", \"second\", \"third\") for (i=0; i<
A simple and efficient way, inspired from the implementation of transform in SeqLike.scala
transform
var i = 0 xs foreach { el => println("String #" + i + " is " + xs(i)) i += 1 }