I want to convert a range of Int into a a List or an Array. I have this code working in Scala 2.8:
var years: List[Int] = List()
val firstYear = 1990
val lastYear = 2011
firstYear.until(lastYear).foreach(
e => years = years.:+(e)
)
I would like to know if there is another syntax possible, to avoid using foreach, I would like to have no loop in this part of code.
Thanks a lot!
Loic