# Extracting all struct fields

**URL:** <https://discourse.julialang.org/t/extracting-all-struct-fields/36115>\
**Category:** General Usage\
**Created:** [March 17, 2020, 9:24pm UTC](https://discourse.julialang.org/t/extracting-all-struct-fields/36115 "2020-03-17T21:24:27Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [March 17, 2020, 9:58pm UTC](https://discourse.julialang.org/t/extracting-all-struct-fields/36115/4 "2020-03-17T21:58:46Z")

</div>

No, I’m afraid there’s no way to do this because there is no way to dynamically create local variables. See [Unpack named tuples (does anyone know how to do it?) - #9 by rdeits](https://discourse.julialang.org/t/unpack-named-tuples-does-anyone-know-how-to-do-it/32456/9) and [Is it possible to get the fieldnames of a struct inside a macro? - #15 by rdeits](https://discourse.julialang.org/t/is-it-possible-to-get-the-fieldnames-of-a-struct-inside-a-macro/33314/15) for some related discussion.

---

_[View the full topic](https://discourse.julialang.org/t/extracting-all-struct-fields/36115)._
