<p dir="auto">Hi guys, I meet a problem when I trying to paralleling my code using multi-thread</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="for (lgt,val) in gp
     absorb!(lgt, val, the_ERR)
end"><pre class="notranslate"><span class="pl-k">for</span> (lgt,val) <span class="pl-k">in</span> gp
     <span class="pl-c1">absorb!</span>(lgt, val, the_ERR)
<span class="pl-k">end</span></pre></div>
<p dir="auto">to</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Threads.@threads for (lgt,val) in gp
        absorb!(lgt, val, the_ERR)
    end"><pre class="notranslate">Threads<span class="pl-k">.</span><span class="pl-c1">@threads</span> <span class="pl-k">for</span> (lgt,val) <span class="pl-k">in</span> gp
        <span class="pl-c1">absorb!</span>(lgt, val, the_ERR)
    <span class="pl-k">end</span></pre></div>
<p dir="auto">gp is a Dict{Int, Array{Myread,1}}()<br>
Myread is my custom struct<br>
function of absorb is complicate to explain, but generally it will filter out some item in the Array according to the lgt variable</p>
<p dir="auto">Everything goes well without <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/threads/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/threads">@threads</a>, but after add @threadand a MethodError will occur and output data in val, like this</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/10047675/49875109-27528a80-fe5b-11e8-9b69-66169387c3d4.png"><img src="https://user-images.githubusercontent.com/10047675/49875109-27528a80-fe5b-11e8-9b69-66169387c3d4.png" alt="wx20181212-221316" style="max-width: 100%;"></a></p>
<p dir="auto">On the master branch, it looks like neither of these currently works,</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; @Threads.threads for (i,j) in [(1,2),(3,4)]
           i
       end
ERROR: syntax: invalid syntax in &quot;local&quot; declaration"><pre class="notranslate">julia<span class="pl-k">&gt;</span> <span class="pl-c1">@Threads</span><span class="pl-k">.</span>threads <span class="pl-k">for</span> (i,j) <span class="pl-k">in</span> [(<span class="pl-c1">1</span>,<span class="pl-c1">2</span>),(<span class="pl-c1">3</span>,<span class="pl-c1">4</span>)]
           i
       <span class="pl-k">end</span>
ERROR<span class="pl-k">:</span> syntax<span class="pl-k">:</span> invalid syntax <span class="pl-k">in</span> <span class="pl-s"><span class="pl-pds">"</span>local<span class="pl-pds">"</span></span> declaration</pre></div>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; @Threads.threads for i=1:2, j=3:4
           i
       end
ERROR: syntax: invalid assignment location &quot;i=1:2&quot;"><pre class="notranslate">julia<span class="pl-k">&gt;</span> <span class="pl-c1">@Threads</span><span class="pl-k">.</span>threads <span class="pl-k">for</span> i<span class="pl-k">=</span><span class="pl-c1">1</span><span class="pl-k">:</span><span class="pl-c1">2</span>, j<span class="pl-k">=</span><span class="pl-c1">3</span><span class="pl-k">:</span><span class="pl-c1">4</span>
           i
       <span class="pl-k">end</span>
ERROR<span class="pl-k">:</span> syntax<span class="pl-k">:</span> invalid assignment location <span class="pl-s"><span class="pl-pds">"</span>i=1:2<span class="pl-pds">"</span></span></pre></div>
<p dir="auto">I think this might be low hanging enough fruit that even I could figure it out. Would a PR adding this functionality be something the developers are interested in?</p>