title: Julia splat operator unpacking
body: <p>In Python, one can use the <code>*</code> operator in the unpacking of an iterable.</p>
  
  <pre><code>In [1]: head, *tail = [1, 2, 3, 4, 5]
  
  In [2]: head
  Out[2]: 1
  
  In [3]: tail
  Out[3]: [2, 3, 4, 5]
  </code></pre>
  
  <p>I would like to produce the same behavior in Julia. I figured that the equivalent <code>...</code> operator would work, but it seems to just produce an error in this context.</p>
  
  <pre><code>julia&gt; head, tail... = [1, 2, 3, 4, 5]
  ERROR: syntax: invalid assignment location "tail..."
  </code></pre>
  
  <p>I was able to produce the results I want using the following, but this is an ugly solution.</p>
  
  <pre><code>julia&gt; head, tail = A[1], A[2:end]
  (1,[2,3,4,5])
  </code></pre>
  
  <p>Can I unpack the array such that <code>tail</code> would contain the rest of the items after <code>head</code> using the splat (<code>...</code>) operator? If not, what is the cleanest alternative?</p>
  
  <hr>
  
  <p><strong>Edit:</strong> This feature has been proposed in <a href="https://github.com/JuliaLang/julia/issues/2626" rel="nofollow noreferrer">#2626</a>. It looks like it will be part of the 1.0 release.</p>