<p dir="auto">In julia, is there some syntax similar to<br>
<code class="notranslate">(x,z...) = (1,2,3)</code> which would result in<br>
<code class="notranslate">x=1</code> &amp; <code class="notranslate">z=(2,3)</code>?</p>
<p dir="auto">If not, are there reasons why this was not supported, or perhaps this could be a reasonable feature request (or, more constructively, prior to working on a PR, do others have thoughts about this)?</p>
<p dir="auto">Ideally, since nested destructuring e.g. <code class="notranslate">(a,(b,c)) = (1,(2,3))</code> works as expected, any variadic version would also work e.g.<br>
<code class="notranslate">(a,(b,c,d...),e...) = (1,(2,3,4,5),6,7)</code> would yield</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="a=1
b=2
c=3
d=(4,5)
e=(6,7)"><pre class="notranslate"><code class="notranslate">a=1
b=2
c=3
d=(4,5)
e=(6,7)
</code></pre></div>
<p dir="auto">And perhaps</p>
<p dir="auto"><code class="notranslate">(a,(b,c,d...),e..., nexttolast, last) = (1,(2,3,4,5),6,7,8,9,10)</code> would yield</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="a=1
b=2
c=3
d=(4,5)
e=(6,7,8)
nexttolast=9
last=10"><pre class="notranslate"><code class="notranslate">a=1
b=2
c=3
d=(4,5)
e=(6,7,8)
nexttolast=9
last=10
</code></pre></div>
<p dir="auto">While <code class="notranslate">(a,(b,c,d...),e..., nexttolast, last) = (1,(2,3,4,5),9,10)</code> would yield</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="a=1
b=2
c=3
d=(4,5)
e=()
nexttolast=9
last=10"><pre class="notranslate"><code class="notranslate">a=1
b=2
c=3
d=(4,5)
e=()
nexttolast=9
last=10
</code></pre></div>
<p dir="auto">And finally <code class="notranslate">(a,(b,c,d...),e..., nexttolast, last) = (1,(2,3,4,5),10)</code> would result in an error, just<br>
like the current behavior for <code class="notranslate">(a,b) = 1</code></p>
<p dir="auto">This would be a very nice syntax for taking head and rest. Likewise <code class="notranslate">a..., b = [1,2,3]</code> might be good for slurping the initial elements into <code class="notranslate">a</code> and the tail element into <code class="notranslate">b</code>.</p>