title: How to convert Range to List or Array in Scala
body: <p>I want to convert a range of Int into a a List or an Array.
  I have this code working in Scala 2.8:</p>
  
  <pre><code>var years: List[Int] = List()
  val firstYear = 1990
  val lastYear = 2011
  
  firstYear.until(lastYear).foreach(
    e =&gt; years = years.:+(e)
  )
  </code></pre>
  
  <p>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.</p>
  
  <p>Thanks a lot!</p>
  
  <p>Loic</p>