# How to fix the warning for this deprecated syntax

**URL:** <https://discourse.julialang.org/t/how-to-fix-the-warning-for-this-deprecated-syntax/8878>\
**Category:** New to Julia\
**Created:** [February 7, 2018, 1:48am UTC](https://discourse.julialang.org/t/how-to-fix-the-warning-for-this-deprecated-syntax/8878 "2018-02-07T01:48:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![QUANG\_VU\_NGUY\_N\_PH\_M](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/quang_vu_nguy_n_ph_m/32/14299_2.png) [@QUANG\_VU\_NGUY\_N\_PH\_M](https://discourse.julialang.org/u/QUANG_VU_NGUY_N_PH_M)\
**Post date:** [February 7, 2018, 1:48am UTC](https://discourse.julialang.org/t/how-to-fix-the-warning-for-this-deprecated-syntax/8878/1 "2018-02-07T01:48:38Z")

</div>

How to fix the warning for this code?

```julia
function Base.call{T}(expt::Experiment{T}, D::Matrix; inc=expt.inc)
    simulate(T, D, inc...)
end 

```

WARNING: deprecated syntax “call(expt::Experiment{T}, …)”.  
Use “(expt::Experiment{T})(…)” instead.

---

<div class="post-metadata">

**Author:** ![NaOH](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/naoh/32/5632_2.png) [@NaOH](https://discourse.julialang.org/u/NaOH)\
**Post date:** [February 7, 2018, 2:30am UTC](https://discourse.julialang.org/t/how-to-fix-the-warning-for-this-deprecated-syntax/8878/2 "2018-02-07T02:30:58Z")

</div>

This is how the new syntax would look like:

```julia
function (expt::Experiment{T})(D::Matrix; inc=expt.inc) where {T}
    simulate(T, D, inc...)
end

```

---

<div class="post-metadata">

**Author:** ![QUANG\_VU\_NGUY\_N\_PH\_M](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/quang_vu_nguy_n_ph_m/32/14299_2.png) [@QUANG\_VU\_NGUY\_N\_PH\_M](https://discourse.julialang.org/u/QUANG_VU_NGUY_N_PH_M)\
**Post date:** [February 7, 2018, 3:41am UTC](https://discourse.julialang.org/t/how-to-fix-the-warning-for-this-deprecated-syntax/8878/3 "2018-02-07T03:41:59Z")

</div>

Thank you for your answer, but how to write it in version 0.5?

I have error with version 0.5:  
“ERROR: LoadError: LoadError: syntax: space before “{” not allowed in “where {”  
in include\_from\_node1(::String) at ./loading.jl:488  
in include\_from\_node1(::String) at /usr/local/Cellar/julia/0.5.1/lib/julia/sys.dylib:?  
in eval(::Module, ::Any) at ./boot.jl:234  
in eval(::Module, ::Any) at /usr/local/Cellar/julia/0.5.1/lib/julia/sys.dylib:?  
in require(::Symbol) at ./loading.jl:415  
in require(::Symbol) at /usr/local/Cellar/julia/0.5.1/lib/julia/sys.dylib:?  
in include\_from\_node1(::String) at ./loading.jl:488  
in include\_from\_node1(::String) at /usr/local/Cellar/julia/0.5.1/lib/julia/sys.dylib:?  
in process\_options(::Base.JLOptions) at ./client.jl:265  
in \_start() at ./client.jl:321  
in \_start() at /usr/local/Cellar/julia/0.5.1/lib/julia/sys.dylib:?  
while loading /Users/nguyenvu/.julia/v0.5/ElementSimulator/src/ElementSimulator.jl, in expression starting on line 71  
while loading /Users/nguyenvu/.julia/v0.5/Materials2/test/runtests.jl, in expression starting on line 1”

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [February 7, 2018, 7:56am UTC](https://discourse.julialang.org/t/how-to-fix-the-warning-for-this-deprecated-syntax/8878/4 "2018-02-07T07:56:50Z")

</div>

If you are rewriting code from `< v0.5` anyway, perhaps you would be better off switching to `v0.6.2` without further ado, saving an extra rewrite. The `NEWS.md` files in the [Julia repository](https://github.com/JuliaLang/julia) have the release notes (select with a tag) which list the changes.
