<p dir="auto">I first brought this up in the julia users group <a href="https://groups.google.com/forum/#!topic/julia-users/9XENk9Wd1YA" rel="nofollow">here</a>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia&gt; list = [&quot;a&quot;, &quot;b&quot;, &quot;c&quot;]
       for i in enumerate(list)
         println(i)
       end

(1,&quot;a&quot;)
(2,&quot;b&quot;)
(3,&quot;c&quot;)"><pre class="notranslate"><code class="notranslate">julia&gt; list = ["a", "b", "c"]
       for i in enumerate(list)
         println(i)
       end

(1,"a")
(2,"b")
(3,"c")
</code></pre></div>
<p dir="auto">But:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia&gt; addprocs(2)

       @parallel for i in enumerate(list)
         println(i)
       end

ERROR: `getindex` has no method matching getindex(::Enumerate{Array{ASCIIString,1}}, ::UnitRange{Int64})"><pre class="notranslate"><code class="notranslate">julia&gt; addprocs(2)

       @parallel for i in enumerate(list)
         println(i)
       end

ERROR: `getindex` has no method matching getindex(::Enumerate{Array{ASCIIString,1}}, ::UnitRange{Int64})
</code></pre></div>
<p dir="auto">As <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Ismael-VC/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Ismael-VC">@Ismael-VC</a> pointed out in the user group, it works in parallel with</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia&gt; @parallel for i in collect(enumerate(list))
                  println(i)
       end"><pre class="notranslate"><code class="notranslate">julia&gt; @parallel for i in collect(enumerate(list))
                  println(i)
       end
</code></pre></div>
<p dir="auto">But it seems a bit confusing to me that the behaviour of <code class="notranslate">enumerate()</code> changes depending on whether the loop is run in parallel or not.</p>
<p dir="auto">Consider this code:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="A = eye(3)
B = {A,A,A}

for (a1,a2) in zip(B,B)
  a1+a2
end"><pre class="notranslate">A <span class="pl-k">=</span> <span class="pl-c1">eye</span>(<span class="pl-c1">3</span>)
B <span class="pl-k">=</span> {A,A,A}

<span class="pl-k">for</span> (a1,a2) <span class="pl-k">in</span> <span class="pl-c1">zip</span>(B,B)
  a1<span class="pl-k">+</span>a2
<span class="pl-k">end</span></pre></div>
<p dir="auto">It works fine. If I add <code class="notranslate">@parallel (+)</code> it fails with:</p>
<blockquote>
<p dir="auto">exception on 1: ERROR: MethodError: <code class="notranslate">getindex</code> has no method matching getindex(::Base.Zip2{Array{Any,1},Array{Any,1}}, ::Int64)<br>
in anonymous at no file:1471<br>
in anonymous at multi.jl:1320<br>
in run_work_thunk at multi.jl:617<br>
in run_work_thunk at multi.jl:626<br>
in anonymous at task.jl:6</p>
</blockquote>