# Syntax error when interpolating name of const variable

**URL:** https://discourse.julialang.org/t/syntax-error-when-interpolating-name-of-const-variable/6635
**Category:** New to Julia
**Created:** [October 23, 2017, 8:21pm UTC](https://discourse.julialang.org/t/syntax-error-when-interpolating-name-of-const-variable/6635 "2017-10-23T20:21:22Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![grahamas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/grahamas/32/3401_2.png) [@grahamas](https://discourse.julialang.org/u/grahamas)
#### Post date: [October 23, 2017, 8:21pm UTC](https://discourse.julialang.org/t/syntax-error-when-interpolating-name-of-const-variable/6635/1 "2017-10-23T20:21:22Z")

</div>

When trying to create a macro involving a const declaration whose variable name is interpreted, I ran across the error: syntax: expected assignment after “const”

Trying to debug, I eventually tried dumping the expression, but unfortunately that produces the same error so I can’t see what the problem is. `dump(:(const hello_five = 5))` works fine, but `dump(:(const $(name)_five = 5)` produces the above syntax error. How else could I try debugging this? And, does anyone know what my mistake is?

---

<div class="post-metadata">

### Author: ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)
#### Post date: [October 23, 2017, 8:30pm UTC](https://discourse.julialang.org/t/syntax-error-when-interpolating-name-of-const-variable/6635/2 "2017-10-23T20:30:02Z")

</div>

Interpolation create distinct objects/expressions and will not affect the parsing of the expression. The `$(name)_five` will not be merged to a single symbol even if `name`’s value is a symbol. You have to do that explicitly with `name_five = Symbol(name, "_five")` and interpolate the new symbol `name_five`

---

<div class="post-metadata">

### Author: ![grahamas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/grahamas/32/3401_2.png) [@grahamas](https://discourse.julialang.org/u/grahamas)
#### Post date: [October 25, 2017, 3:57pm UTC](https://discourse.julialang.org/t/syntax-error-when-interpolating-name-of-const-variable/6635/3 "2017-10-25T15:57:29Z")

</div>

Thank you! I hadn’t realized that.
