# Nested macro interpolation

**URL:** <https://discourse.julialang.org/t/nested-macro-interpolation/106547>\
**Category:** General Usage\
**Tags:** metaprogramming\
**Created:** [November 21, 2023, 7:12pm UTC](https://discourse.julialang.org/t/nested-macro-interpolation/106547 "2023-11-21T19:12:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![filchristou](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/filchristou/32/26760_2.png) [@filchristou](https://discourse.julialang.org/u/filchristou)\
**Post date:** [November 21, 2023, 7:12pm UTC](https://discourse.julialang.org/t/nested-macro-interpolation/106547/1 "2023-11-21T19:12:57Z")

</div>

How to interpolate when having nested macros ?

E.g., a toy example

```julia
julia> using Distributed

julia> using BenchmarkTools

julia> @everywhere function bencheverywhere()
               for k in 1:2
                       @btime sin($k)
               end
       end
ERROR: UndefVarError: `k` not defined
Stacktrace:
 [1] top-level scope
   @ ~/.julia/juliaup/julia-1.9.4+0.x64.linux.gnu/share/julia/stdlib/v1.9/Distributed/src/macros.jl:201

```
