# Metaprogramming using eval and struct: BUG getting UndefVarError: not defined

**URL:** <https://discourse.julialang.org/t/metaprogramming-using-eval-and-struct-bug-getting-undefvarerror-not-defined/37937>\
**Category:** General Usage\
**Tags:** question, bug, eval, struct\
**Created:** [April 21, 2020, 12:23am UTC](https://discourse.julialang.org/t/metaprogramming-using-eval-and-struct-bug-getting-undefvarerror-not-defined/37937 "2020-04-21T00:23:17Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![JosephPollacco](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/josephpollacco/32/51404_2.png) [@JosephPollacco](https://discourse.julialang.org/u/JosephPollacco)\
**Post date:** [April 30, 2020, 6:00am UTC](https://discourse.julialang.org/t/metaprogramming-using-eval-and-struct-bug-getting-undefvarerror-not-defined/37937/21 "2020-04-30T06:00:43Z")

</div>

_NamedTuple_ are great and seem to be more flexible than structure, which I am testing in my code.

The only downside is that _NamedTuple_ are **immutable** and that to my understanding there is no option to make them **mutable** , is that correct?

---

<div class="post-metadata">

**Author:** ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)\
**Post date:** [April 30, 2020, 7:20am UTC](https://discourse.julialang.org/t/metaprogramming-using-eval-and-struct-bug-getting-undefvarerror-not-defined/37937/22 "2020-04-30T07:20:46Z")

</div>

There was a recent discussion about that on Discourse:

[https://discourse.julialang.org/t/alternative-to-mutable-named-tuple/38375](https://discourse.julialang.org/t/alternative-to-mutable-named-tuple/38375)

---

<div class="post-metadata">

**Author:** ![JosephPollacco](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/josephpollacco/32/51404_2.png) [@JosephPollacco](https://discourse.julialang.org/u/JosephPollacco)\
**Post date:** [May 1, 2020, 3:22am UTC](https://discourse.julialang.org/t/metaprogramming-using-eval-and-struct-bug-getting-undefvarerror-not-defined/37937/23 "2020-05-01T03:22:04Z")

</div>

Thanks a good discussion which addresses nicely my questions.

[Previous page](https://discourse.julialang.org/t/metaprogramming-using-eval-and-struct-bug-getting-undefvarerror-not-defined/37937.md?page=1)
