# Variable interpolation

**URL:** <https://discourse.julialang.org/t/variable-interpolation/117769>\
**Category:** New to Julia\
**Tags:** metaprogramming\
**Created:** [August 2, 2024, 4:39pm UTC](https://discourse.julialang.org/t/variable-interpolation/117769 "2024-08-02T16:39:56Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [August 2, 2024, 4:43pm UTC](https://discourse.julialang.org/t/variable-interpolation/117769/2 "2024-08-02T16:43:54Z")

</div>

> [@geoffD](#):
>
> I would like to be able to issue the following command:  
> `($v1)at` and get back `"I am a mat"`

You can use `eval(Meta.parse("$(v1)at()"))`, for example.

However, this sounds like a classic [XY problem](https://xyproblem.info/), in which you are reaching for the wrong tool for the job. What are you ultimately trying to accomplish?

In general, you almost _never_ need to pass functions or expressions as strings — Julia has much better ways to deal with functions as variables. See also [How one can evaluate @printf to be returned to a value - #6 by stevengj](https://discourse.julialang.org/t/how-one-can-evaluate-printf-to-be-returned-to-a-value/117669/6)

---

_[View the full topic](https://discourse.julialang.org/t/variable-interpolation/117769)._
