title: Nim: How to iterate over a slice?
body: <p>I'm puzzled by the following observation. On the one hand, this works:</p>
  
  <pre><code>for i in 5..10:
    echo i
  </code></pre>
  
  <p>But as soon as I store the slice in a variable, I can no longer iterate over it, i.e., this fails:</p>
  
  <pre><code>var slice = 5..10
  for i in slice:
    echo i
  </code></pre>
  
  <p>The error is <code>type mismatch: got (Slice[system.int])</code>, and apparently there is no overloaded signature of the <code>system.items</code> iterator for <code>Slice[T]</code>. This raises the questions:</p>
  
  <ul>
  <li>Why does it work at all in the first case?</li>
  <li>Is there a workaround to iterate over a slice in the second case?</li>
  </ul>