# Macrocall with Expr

**URL:** <https://discourse.julialang.org/t/macrocall-with-expr/16518>\
**Category:** New to Julia\
**Created:** [October 19, 2018, 3:19am UTC](https://discourse.julialang.org/t/macrocall-with-expr/16518 "2018-10-19T03:19:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chkwon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chkwon/32/3632_2.png) [@chkwon](https://discourse.julialang.org/u/chkwon)\
**Post date:** [October 19, 2018, 3:19am UTC](https://discourse.julialang.org/t/macrocall-with-expr/16518/1 "2018-10-19T03:19:44Z")

</div>

I’m in Julia v0.7.

```julia
using JuMP
m = Model()
@variable(m, x)

#1
@NLconstraint(m, x == 0)

#2
e2 = :(@NLconstraint(m, x == 0))
eval(e2)

#3
e3 = Expr(:macrocall, Symbol("@NLconstraint"), :m, :(x==0))
eval(e3)

#4
sub_e = Expr(:call, :(==), :x, 0)
e4 = Expr(:macrocall, Symbol("@NLconstraint"), :m, sub_e)
eval(e4)

```

In the above, #1 and #2 produce the same result, but #3 creates an error. As I examined

```julia
julia> e2.args
4-element Array{Any,1}:
 Symbol("@NLconstraint")
 :(#= REPL[124]:2 =#)   
 :m                     
 :(x == 0)     

```

I see `:(#= REPL[124]:2 =#)`. What is this? How should I modify #3? Can I make #4 also work?
