# Quoting operator & literals

**URL:** https://discourse.julialang.org/t/quoting-operator-literals/1327
**Category:** General Usage
**Tags:** question
**Created:** [January 6, 2017, 3:30pm UTC](https://discourse.julialang.org/t/quoting-operator-literals/1327 "2017-01-06T15:30:20Z")
**Posts on this page:** 1
**Showing post:** 5

<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: [January 6, 2017, 4:14pm UTC](https://discourse.julialang.org/t/quoting-operator-literals/1327/5 "2017-01-06T16:14:10Z")

</div>

Anything can be an expression (or part of an expression) in Julia. Eg

```julia
julia> immutable Foo x end
julia> dump(:(x + $(Foo(9))))
Expr
  head: Symbol call
  args: Array{Any}((3,))
    1: Symbol +
    2: Symbol x
    3: Foo
      x: Int64 9
  typ: Any

```

so `Foo(9)` is just sitting there as an argument until `+` is called, and it is not an `Expr`, which `:(Foo(9))` would be. (See [this comment](https://discourse.julialang.org/t/how-to-construct-expr-tuple-using-templates/1305/2) on a question I asked recently for related concepts).

More related to your application: I imagine a symbol eg `:x` is also symbolically differentiable, and it is not an expression. So don’t restrict the types.

Finally, you may find this library useful:

> **[GitHub - FluxML/MacroTools.jl: MacroTools provides a library of tools for...](https://github.com/FluxML/MacroTools.jl)**
>
> MacroTools provides a library of tools for working with Julia code and expressions. - GitHub - FluxML/MacroTools.jl: MacroTools provides a library of tools for working with Julia code and expressions.

---

_[View the full topic](https://discourse.julialang.org/t/quoting-operator-literals/1327)._
