# Expression parser

**URL:** <https://discourse.julialang.org/t/expression-parser/41880>\
**Category:** New to Julia\
**Created:** [June 22, 2020, 6:49pm UTC](https://discourse.julialang.org/t/expression-parser/41880 "2020-06-22T18:49:51Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![stillyslalom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stillyslalom/32/45687_2.png) [@stillyslalom](https://discourse.julialang.org/u/stillyslalom)\
**Post date:** [June 22, 2020, 7:27pm UTC](https://discourse.julialang.org/t/expression-parser/41880/3 "2020-06-22T19:27:56Z")

</div>

```julia
julia> module UserCode end
Main.UserCode

julia> const UC = Main.UserCode
Main.UserCode

julia> include_string(UC, "x = 3; y = 4; z(x, y) = 2 + 3x - exp(-y)")
z (generic function with 1 method)

julia> x0, y0 = UC.x, UC.y
(3, 4)

julia> UC.z(x0, y0)
10.981684361111267

julia> z
ERROR: UndefVarError: z not defined

```

This is flexible but dangerous, as it allows the user to run arbitrary code. See this post for other approaches: [Evaluate expression in function](https://discourse.julialang.org/t/evaluate-expression-in-function/24402)

---

_[View the full topic](https://discourse.julialang.org/t/expression-parser/41880)._
