title: Value assignment inside for-loop in Scala
body: <p>Is there any difference between this code:</p>
  
  <pre><code>    for(term &lt;- term_array) {
          val list = hashmap.get(term)
          ...
      }
  </code></pre>
  
  <p>and:</p>
  
  <pre><code>    for(term &lt;- term_array; val list = hashmap.get(term)) {
          ...
      }
  </code></pre>
  
  <p>Inside the loop I'm changing the hashmap with something like this</p>
  
  <pre><code>hashmap.put(term, string :: list)
  </code></pre>
  
  <p>While checking for the head of <code>list</code> it seems to be outdated somehow when using the second code snippet. </p>