title: Why is shortcut with `map` not working?
body: <p>The two lines in this code:</p>
  
  <pre><code>p ["9", "6", "4"]
  p %w(9 6 4)
  </code></pre>
  
  <p>return exactly the same array <code>["9", "6", "4"]</code>. But the first line with <code>map</code>:</p>
  
  <pre><code>p ["9", "6", "4"].map(&amp;:to_i)
  </code></pre>
  
  <p>works fine, and the second one:</p>
  
  <pre><code>p %w(9 6 4).map{&amp;:to_i}
  </code></pre>
  
  <p>gives:</p>
  
  <pre><code>syntax error, unexpected &amp;
  p %w(9 6 4).map{&amp;:to_i}
  </code></pre>
  
  <p>I also tried to wrap it in bracers <code>(%w(9 6 4)).map(&amp;:to_i)</code>, but had no luck. What is the problem with this code? <code>%w(...)</code> is a shortcut for array of strings. Why is it not working in the same way?</p>
  
  <hr>
  
  <p><strong>UPD</strong></p>
  
  <p>Ok, I got it. That's a stupid question, but I can't delete this question, since it has answers already. I voted to close it..</p>