# Save variable to variable name

**URL:** <https://discourse.julialang.org/t/save-variable-to-variable-name/24565>\
**Category:** General Usage\
**Tags:** question, metaprogramming\
**Created:** [May 24, 2019, 12:53pm UTC](https://discourse.julialang.org/t/save-variable-to-variable-name/24565 "2019-05-24T12:53:08Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [May 24, 2019, 1:15pm UTC](https://discourse.julialang.org/t/save-variable-to-variable-name/24565/2 "2019-05-24T13:15:28Z")

</div>

This should work:

```julia
@eval save($s, joinpath(repo, $("$s.jldb")))

```

You need to rounds of `$`: one for interpolating the symbol into the expression; another to interpolate the symbol name into the string (exactly like you’d have to without metaprogramming)

---

_[View the full topic](https://discourse.julialang.org/t/save-variable-to-variable-name/24565)._
