# Weird Eval Problem / Help needed

**URL:** <https://discourse.julialang.org/t/weird-eval-problem-help-needed/11062>\
**Category:** General Usage\
**Created:** [May 22, 2018, 1:31am UTC](https://discourse.julialang.org/t/weird-eval-problem-help-needed/11062 "2018-05-22T01:31:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Qiyamah](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/qiyamah/32/2660_2.png) [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Post date:** [May 22, 2018, 1:31am UTC](https://discourse.julialang.org/t/weird-eval-problem-help-needed/11062/1 "2018-05-22T01:31:19Z")

</div>

```nohighlight
julia> mydict = Dict{Symbol,Any}()
Dict{Symbol,Any} with 0 entries

julia> mydict[:m] = 100
100

julia> eval(:($(Expr(:escape, :(mydict[:m])))))
ERROR: syntax: invalid syntax (escape (call (outerref getindex) (outerref mydict) (inert m)))
Stacktrace:
 [1] eval(::Module, ::Any) at ./boot.jl:235
 [2] eval(::Any) at ./boot.jl:234

```

Hi fellows, I am getting the following error, but i can’t figure out why.

---

<div class="post-metadata">

**Author:** ![jandehaan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jandehaan/32/6805_2.png) [@jandehaan](https://discourse.julialang.org/u/jandehaan)\
**Post date:** [May 22, 2018, 2:16am UTC](https://discourse.julialang.org/t/weird-eval-problem-help-needed/11062/2 "2018-05-22T02:16:28Z")

</div>

What is the actual use case? What exactly are you trying to accomplish?

---

<div class="post-metadata">

**Author:** ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)\
**Post date:** [May 22, 2018, 5:59am UTC](https://discourse.julialang.org/t/weird-eval-problem-help-needed/11062/3 "2018-05-22T05:59:36Z")

</div>

+1 to describing your use-case, or at least an example which is self-explanatory.

Escape (usually used through the `esc`-function) is only allowed in a macro:

```julia

help?> esc                                                                                                                                                               
search: esc escape_string unescape_string getsockname intersect intersect! hessfact hessfact! DenseVector DenseVecOrMat mutable struct typeintersect SparseMatrixCSC     

  esc(e::ANY)

  Only valid in the context of an Expr returned from a macro. Prevents the macro hygiene pass from turning embedded variables into gensym variables. See the Macros      
  section of the Metaprogramming chapter of the manual for more details and examples.                                                                                    

```
