# How to get lowered names of functions with kwargs to precompile

**URL:** https://discourse.julialang.org/t/how-to-get-lowered-names-of-functions-with-kwargs-to-precompile/41861
**Category:** General Usage
**Created:** [June 22, 2020, 1:47pm UTC](https://discourse.julialang.org/t/how-to-get-lowered-names-of-functions-with-kwargs-to-precompile/41861 "2020-06-22T13:47:33Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)
#### Post date: [June 22, 2020, 1:47pm UTC](https://discourse.julialang.org/t/how-to-get-lowered-names-of-functions-with-kwargs-to-precompile/41861/1 "2020-06-22T13:47:33Z")

</div>

Hi!

I have a lot of functions in a package that has keywords arguments and I want to precompile them. However, I am not sure how can I get the lowered name. For example:

```julia
julia> function teste(::Val{:a}; b = 1, c = 2)
       b+c
       end
teste (generic function with 1 method)

julia> function teste(::Val{:b}; d = 1, e = 2)
       d-e
       end
teste (generic function with 2 methods)

julia> @code_lowered teste(Val(:a))
CodeInfo(
1 ─ %1 = Main.:(var"#teste#4")(1, 2, #self#, @_2)
└── return %1
)

julia> @code_lowered teste(Val(:b))
CodeInfo(
1 ─ %1 = Main.:(var"#teste#5")(1, 2, #self#, @_2)
└── return %1
)

```

Is there any function that returns me the name ` Main.:(var"#teste#5")`? I tried to precompile the functions using the call in `Core.kwfunc`, but it is not enough.

---

<div class="post-metadata">

### Author: ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)
#### Post date: [June 22, 2020, 2:44pm UTC](https://discourse.julialang.org/t/how-to-get-lowered-names-of-functions-with-kwargs-to-precompile/41861/2 "2020-06-22T14:44:59Z")

</div>

I found a method to do this here:

[https://github.com/juliamatlab/MatLang/blob/master/deps/SnoopCompile/precompile/apple/1.4/precompile\_MatLang.jl](https://github.com/juliamatlab/MatLang/blob/master/deps/SnoopCompile/precompile/apple/1.4/precompile_MatLang.jl)
