# Dict Expression Problem

**URL:** <https://discourse.julialang.org/t/dict-expression-problem/5921>\
**Category:** General Usage\
**Tags:** question\
**Created:** [September 16, 2017, 3:37pm UTC](https://discourse.julialang.org/t/dict-expression-problem/5921 "2017-09-16T15:37:38Z")\
**Posts on this page:** 5\
**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:** [September 16, 2017, 3:37pm UTC](https://discourse.julialang.org/t/dict-expression-problem/5921/1 "2017-09-16T15:37:38Z")

</div>

Hi,

I am getting the following error:

```nohighlight
julia> ex =Expr(:call,:Dict{Symbol,Tuple{Function,Function}},(:x => (()->begin x end, x330-> begin x= x330 end)))
ERROR: TypeError: Type{...} expression: expected Type{T}, got Symbol

```

I can’t figure out why?  
Thanks

---

<div class="post-metadata">

**Author:** ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)\
**Post date:** [September 16, 2017, 3:45pm UTC](https://discourse.julialang.org/t/dict-expression-problem/5921/2 "2017-09-16T15:45:39Z")

</div>

Put parenthesis around quotes.

The error message isn’t given for no reason, you should be able to figure out what’s wrong by running each arguments.

---

<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:** [September 16, 2017, 3:49pm UTC](https://discourse.julialang.org/t/dict-expression-problem/5921/3 "2017-09-16T15:49:43Z")

</div>

> [@yuyichao](#):
>
> The error message isn’t given for no reason, you should be able to figure out what’s wrong by running each arguments.

```Julia
Dict(:x => (()->begin x end, x11-> begin x= x11 end))
Dict{Symbol,Tuple{##17#19,##18#20}} with 1 entry:
  :x => (#17,#18)

Dict{Symbol,Tuple{Function,Function}}(:x => (()->begin x end, x11-> begin x= x11 end))
Dict{Symbol,Tuple{Function,Function}} with 1 entry:
  :x => (#25,#26)

 ex = :(Dict{Symbol,Tuple{Function,Function}}(:x => (()->begin x end, x11-> begin x= x11 end)))
:(Dict{Symbol,Tuple{Function,Function}}(:x => ((()->begin # REPL[13], line 1:
                        begin # REPL[13], line 1:
                            x
                        end
                    end),(x11->begin # REPL[13], line 1:
                        begin # REPL[13], line 1:
                            x = x11
                        end
                    end))))

```

I am doing basically the same thing. I don’t see what I am missing

---

<div class="post-metadata">

**Author:** ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)\
**Post date:** [September 16, 2017, 3:51pm UTC](https://discourse.julialang.org/t/dict-expression-problem/5921/4 "2017-09-16T15:51:49Z")

</div>

You wrote

> [@Qiyamah](#):
>
> Expr(:call,:Dict{Symbol,Tuple{Function,Function}},(:x =\> (()-\>begin x end, x330-\> begin x= x330 end)))

So,

```julia
julia> :call
:call

julia> :Dict{Symbol,Tuple{Function,Function}}
ERROR: TypeError: in Type{...} expression, expected UnionAll, got Symbol

julia> (:x => (()->begin x end, x330-> begin x= x330 end))
:x => (getfield(Main, Symbol("##5#7"))(), getfield(Main, Symbol("##6#8"))())

```

You are also missing the quote on the argument of the call.

---

<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:** [September 16, 2017, 3:54pm UTC](https://discourse.julialang.org/t/dict-expression-problem/5921/5 "2017-09-16T15:54:07Z")

</div>

> [@yuyichao](#):
>
> ted UnionAll, got Symbol

Now i see it, thank you.!
