# Cannot find var's name when I eval an expr

**URL:** <https://discourse.julialang.org/t/cannot-find-vars-name-when-i-eval-an-expr/33460>\
**Category:** General Usage\
**Tags:** question\
**Created:** [January 16, 2020, 10:04pm UTC](https://discourse.julialang.org/t/cannot-find-vars-name-when-i-eval-an-expr/33460 "2020-01-16T22:04:27Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [January 16, 2020, 10:19pm UTC](https://discourse.julialang.org/t/cannot-find-vars-name-when-i-eval-an-expr/33460/2 "2020-01-16T22:19:10Z")

</div>

`eval` works at global scope, so it cannot create local variables inside a function, no matter what you do. There’s some related discussion in [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) .

Can you pass an anonymous function instead of an expression? That should be more flexible and _much_ more efficient.

---

_[View the full topic](https://discourse.julialang.org/t/cannot-find-vars-name-when-i-eval-an-expr/33460)._
