title: Why can't I call methods on a for-yield expression?
body: <p>Say I have some Scala code like this:</p>
  
  <pre><code>// Outputs 1, 4, 9, 16, 25, 36, 49, 64, 81, 100
  println( squares)
  
  def squares = {
      val s = for ( count &lt;- 1 to 10 )
                  yield { count * count }
      s.mkString(", ");
  }
  </code></pre>
  
  <p>Why do I have to use the temporary val s?  I tried this:</p>
  
  <pre><code>def squares = for ( count &lt;- 1 to 10 )
                    yield { count * count }.mkString(", ")
  </code></pre>
  
  <p>That fails to compile with this error message:</p>
  
  <pre><code>error: value mkString is not a member of Int
     def squares = for ( count &lt;- 1 to 10 ) yield { count * count }.mkString(", ")
  </code></pre>
  
  <p>Shouldn't <code>mkString</code> be called on the collection returned by the <code>for</code> loop?</p>