# Destructuring syntax in julia 1.7

**URL:** <https://discourse.julialang.org/t/destructuring-syntax-in-julia-1-7/68236>\
**Category:** Internals & Design\
**Tags:** destructuring\
**Created:** [September 15, 2021, 11:01pm UTC](https://discourse.julialang.org/t/destructuring-syntax-in-julia-1-7/68236 "2021-09-15T23:01:36Z")\
**Posts on this page:** 1\
**Showing post:** 39

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [October 14, 2021, 6:30pm UTC](https://discourse.julialang.org/t/destructuring-syntax-in-julia-1-7/68236/39 "2021-10-14T18:30:15Z")

</div>

It’s a slightly weird syntax, but it’s a useful feature and this is the natural syntax for it. How did we get here?

**Methods definitions**

1. Positional args: `f(x, y)`
2. Positional and keyword args with defaults: `f(x, y; a=1, b=2)`
3. Positional and keyword args without defaults: `f(x, y; a, b)`
4. Keyword args only with defaults: `f(; a=1, b=2)`
5. Keyword args only without defaults: `f(; a, b)`

**Tuple syntax**

1. Construction, like 1 without the function: `(x, y)`
2. Destructuring, like 7 but left of an assignment: `(x, y) = ...`

**Named tuple syntax**

1. Construction with explicit values, like 4 without the function: `(; a=1, b=2)`
2. Construction with implicit values, like 5 without the function: `(; a, b)`
3. Destructuring, like 10 but left of assignment: `(; a, b) = ...`

The only thing that’s new in Julia 1.7 is the last item—named tuple destructuring. Once you see it in the context of all these other syntaxes, perhaps it becomes clear why it’s the only syntax choice that fits in with all the rest.

---

_[View the full topic](https://discourse.julialang.org/t/destructuring-syntax-in-julia-1-7/68236)._
