# Unpack named tuples (does anyone know how to do it?)

**URL:** https://discourse.julialang.org/t/unpack-named-tuples-does-anyone-know-how-to-do-it/32456
**Category:** General Usage
**Created:** [December 18, 2019, 10:15pm UTC](https://discourse.julialang.org/t/unpack-named-tuples-does-anyone-know-how-to-do-it/32456 "2019-12-18T22:15:44Z")
**Posts on this page:** 1
**Showing post:** 9

<div class="post-metadata">

### Author: ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)
#### Post date: [December 19, 2019, 3:08pm UTC](https://discourse.julialang.org/t/unpack-named-tuples-does-anyone-know-how-to-do-it/32456/9 "2019-12-19T15:08:41Z")

</div>

> [@rvignolo](#):
>
> I though that the macro may return something like @longemen3000 suggested.

That’s totally reasonable to hope for, but it won’t work precisely because the suggested code, even if written out by hand, still doesn’t work (it creates global variables, not local ones, because that is inherently how `@eval` always works).

The only way for `@unpack params` to work would be for the type of `params` to be known when the `@unpack` macro is expanded, but that’s impossible: if you’re inside a function, the macro will be expanded before the function is run and therefore before `params` has a value.

---

_[View the full topic](https://discourse.julialang.org/t/unpack-named-tuples-does-anyone-know-how-to-do-it/32456)._
