# Metaprogramming - defining a function

**URL:** <https://discourse.julialang.org/t/metaprogramming-defining-a-function/15491>\
**Category:** New to Julia\
**Tags:** metaprogramming\
**Created:** [September 25, 2018, 10:06pm UTC](https://discourse.julialang.org/t/metaprogramming-defining-a-function/15491 "2018-09-25T22:06:50Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![josemaria](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/josemaria/32/5365_2.png) [@josemaria](https://discourse.julialang.org/u/josemaria)\
**Post date:** [September 27, 2018, 4:46pm UTC](https://discourse.julialang.org/t/metaprogramming-defining-a-function/15491/9 "2018-09-27T16:46:35Z")

</div>

I’m still not getting a solution.

I am looking for the following:

```julia
julia> function f(a)
       local m = :($a)
       m
       end
f (generic function with 1 method)

julia> f(1)
1

```

but when I replace `a` with `Symbol("a")`:

```julia
julia> function f(a)
       local m = :($(Symbol("a")))
       m
       end
f (generic function with 1 method)

julia> f(1)
:a

```

What do I have to do with `Symbol("a")` in order to get `1` instead of `:a`?

---

_[View the full topic](https://discourse.julialang.org/t/metaprogramming-defining-a-function/15491)._
