title: Julia: Using pmap correctly
body: <p>Why doesn't this do what I think it should:</p>
  
  <pre><code>benjamin@benjamin-VirtualBox:~$ julia -p 3
  julia&gt; @everywhere(function foom(bar::Vector{Any}, k::Integer) println(repeat(bar[2],bar[1])); return bar; end)
  julia&gt; foo={{1,"a"},{2,"b"},{3,"c"}}
  julia&gt; pmap(foom, foo, 5)
      From worker 2:  a
  1-element Array{Any,1}:
   {1,"a"}
  </code></pre>
  
  <p>and that is all it outputs. I was expecting pmap to iterate through each tuple in foo and call foom on it. </p>
  
  <p>EDIT:</p>
  
  <p>It works correctly when I don't pass other arguments in:</p>
  
  <pre><code>julia&gt; @everywhere(function foom(bar::Vector{Any}) println(repeat(bar[2],bar[1])); return bar; end)
  
  julia&gt; pmap(foom, foo)
      From worker 3:  bb
      From worker 2:  a
      From worker 4:  ccc
  3-element Array{Any,1}:
   {1,"a"}
   {2,"b"}
   {3,"c"}
  </code></pre>
  
  <p>How can I pass in more arguments to pmap?</p>