先頭に要素追加
var ls = List[int]() ls = 3 :: ls ls = 1 :: ls ls = 4 :: ls ls.foreach(println) // 4, 1, 3
全要素に操作
var ls = List(3, 1, 4) ls = ls.map(_ + 1) ls.foreach(println)
Range
for (item <- List.range(0, 5)) { println(item) } // 0, 1, 2, 3, 4
for (item <- 0 to 5) println(item)