# Apply macro to existing function

**URL:** <https://discourse.julialang.org/t/apply-macro-to-existing-function/73725>\
**Category:** General Usage\
**Tags:** macros\
**Created:** [December 28, 2021, 8:24pm UTC](https://discourse.julialang.org/t/apply-macro-to-existing-function/73725 "2021-12-28T20:24:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jzr](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jzr](https://discourse.julialang.org/u/jzr)\
**Post date:** [December 28, 2021, 8:24pm UTC](https://discourse.julialang.org/t/apply-macro-to-existing-function/73725/1 "2021-12-28T20:24:29Z")

</div>

```julia
f(x) = x + 1

```

Given that function is already defined, is it possible to get the result of applying a macro to it? or is the AST not recoverable once the function is defined?

---

<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:** [December 28, 2021, 9:01pm UTC](https://discourse.julialang.org/t/apply-macro-to-existing-function/73725/2 "2021-12-28T21:01:35Z")

</div>

> [@jzr](#):
>
> or is the AST not recoverable once the function is defined?

You should assume that the AST is not recoverable. What are you trying to accomplish?
