# How to interpolate in nested quotes?

**URL:** <https://discourse.julialang.org/t/how-to-interpolate-in-nested-quotes/27964>\
**Category:** General Usage\
**Created:** [August 25, 2019, 4:27pm UTC](https://discourse.julialang.org/t/how-to-interpolate-in-nested-quotes/27964 "2019-08-25T16:27:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tk3369](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tk3369/32/2824_2.png) [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Post date:** [August 25, 2019, 4:27pm UTC](https://discourse.julialang.org/t/how-to-interpolate-in-nested-quotes/27964/1 "2019-08-25T16:27:32Z")

</div>

Suppose that I have a variable `v` and I want to interpolate it into a nested quote expression. I tried double interpolation but it does not work properly…

This is what I want:

```julia
julia> :( :( x = 1 ) ) |> dump
Expr
  head: Symbol quote
  args: Array{Any}((1,))
    1: Expr
      head: Symbol =
      args: Array{Any}((2,))
        1: Symbol x
        2: Int64 1

```

And, this is what I got:

```julia
julia> v = 1;

julia> :( :( x = $$v ) ) |> dump
Expr
  head: Symbol quote
  args: Array{Any}((1,))
    1: Expr
      head: Symbol =
      args: Array{Any}((2,))
        1: Symbol x
        2: Expr
          head: Symbol $
          args: Array{Any}((1,))
            1: Int64 1

```

---

<div class="post-metadata">

**Author:** ![ffevotte](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ffevotte/32/6587_2.png) [@ffevotte](https://discourse.julialang.org/u/ffevotte)\
**Post date:** [August 25, 2019, 10:31pm UTC](https://discourse.julialang.org/t/how-to-interpolate-in-nested-quotes/27964/2 "2019-08-25T22:31:26Z")

</div>

Would this work in your real use case?

```julia
julia> v = 1;
julia> Meta.quot(:(x=$v)) |> dump
Expr
  head: Symbol quote
  args: Array{Any}((1,))
    1: Expr
      head: Symbol =
      args: Array{Any}((2,))
        1: Symbol x
        2: Int64 1

```

---

<div class="post-metadata">

**Author:** ![tk3369](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tk3369/32/2824_2.png) [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Post date:** [August 27, 2019, 2:22am UTC](https://discourse.julialang.org/t/how-to-interpolate-in-nested-quotes/27964/3 "2019-08-27T02:22:17Z")

</div>

Thanks. I don’t really have a use case yet but as I’m learning how it works it doesn’t seem intuitive.
