# Unexpected behavior of @eval on v0.7?

**URL:** https://discourse.julialang.org/t/unexpected-behavior-of-eval-on-v0-7/10609
**Category:** General Usage
**Tags:** package
**Created:** [April 29, 2018, 6:30pm UTC](https://discourse.julialang.org/t/unexpected-behavior-of-eval-on-v0-7/10609 "2018-04-29T18:30:05Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![tlnagy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tlnagy/32/5815_2.png) [@tlnagy](https://discourse.julialang.org/u/tlnagy)
#### Post date: [April 29, 2018, 6:30pm UTC](https://discourse.julialang.org/t/unexpected-behavior-of-eval-on-v0-7/10609/1 "2018-04-29T18:30:05Z")

</div>

I’m working on [https://github.com/GiovineItalia/Compose.jl/pull/282](https://github.com/GiovineItalia/Compose.jl/pull/282) and I ran into a change in how eval behaves on v0.6 to v0.7 and AFAIK the change isn’t documented.

on v0.6

```julia
julia> ex = Expr(:import, Symbol("Fontconfig"))
:(import Fontconfig)

julia> @eval $ex
ERROR: ArgumentError: Module Fontconfig not found in current path.
Run `Pkg.add("Fontconfig")` to install the Fontconfig package.
Stacktrace:
 [1] _require(::Symbol) at ./loading.jl:435
 [2] require(::Symbol) at ./loading.jl:405
 [3] eval(::Module, ::Expr) at ./sysimg.jl:23

julia> import Fontconfig
ERROR: ArgumentError: Module Fontconfig not found in current path.
Run `Pkg.add("Fontconfig")` to install the Fontconfig package.
Stacktrace:
 [1] _require(::Symbol) at ./loading.jl:435
 [2] require(::Symbol) at ./loading.jl:405

```

while on v0.7.0-DEV.4958 (2 day old master)

```julia
julia> ex = Expr(:import, Symbol("Fontconfig"))
:(import Fontconfig)

julia> @eval $ex

julia> import Fontconfig
ERROR: ArgumentError: Module Fontconfig not found in current path.
Run `Pkg.add("Fontconfig")` to install the Fontconfig package.
Stacktrace:
 [1] require(::Module, ::Symbol) at ./loading.jl:864

```

`Fontconfig` isn’t installed in either case. I don’t see why there is a discrepancy between `@eval`ing an import statement and running the actual `import` statement?

---

<div class="post-metadata">

### Author: ![tlnagy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tlnagy/32/5815_2.png) [@tlnagy](https://discourse.julialang.org/u/tlnagy)
#### Post date: [April 30, 2018, 4:04pm UTC](https://discourse.julialang.org/t/unexpected-behavior-of-eval-on-v0-7/10609/2 "2018-04-30T16:04:20Z")

</div>

I’m not sure if this a bug at this point, but I’m thinking of posting it on the github issue tracker

---

<div class="post-metadata">

### Author: ![jameson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jameson/32/23_2.png) [@jameson](https://discourse.julialang.org/u/jameson)
#### Post date: [July 10, 2018, 8:17pm UTC](https://discourse.julialang.org/t/unexpected-behavior-of-eval-on-v0-7/10609/3 "2018-07-10T20:17:34Z")

</div>

Not sure why it doesn’t throw an error, but the syntax is wrong. On v0.7, it should be:

```julia
eval(Expr(:import, Expr(:., :Fontconfig)))

```

Although probably easier and better to just to load the module directly:

```julia
local FC = Base.require(@ __MODULE__ , :Fontconfig)

```

Or even better, to use Requires.jl to do the work for you at runtime
