# How to extract the names of functions from a Julia file?

**URL:** https://discourse.julialang.org/t/how-to-extract-the-names-of-functions-from-a-julia-file/23650
**Category:** New to Julia
**Tags:** question
**Created:** [April 29, 2019, 1:56pm UTC](https://discourse.julialang.org/t/how-to-extract-the-names-of-functions-from-a-julia-file/23650 "2019-04-29T13:56:14Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![leiteiro](https://avatars.discourse-cdn.com/v4/letter/l/b5e925/32.png) [@leiteiro](https://discourse.julialang.org/u/leiteiro)
#### Post date: [April 29, 2019, 1:56pm UTC](https://discourse.julialang.org/t/how-to-extract-the-names-of-functions-from-a-julia-file/23650/1 "2019-04-29T13:56:14Z")

</div>

Consider the following file fragment:

```
function plus(a, b)
    return a + b
end
minus(a, b) = a - b

```

I want to parse this file to extract the names of the functions. Thus in the example I wish to obtain the list [“plus”, “minus”]. How can this be done in the simplest manner?

---

<div class="post-metadata">

### Author: ![BeastyBlacksmith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/beastyblacksmith/32/4741_2.png) [@BeastyBlacksmith](https://discourse.julialang.org/u/BeastyBlacksmith)
#### Post date: [April 29, 2019, 3:32pm UTC](https://discourse.julialang.org/t/how-to-extract-the-names-of-functions-from-a-julia-file/23650/2 "2019-04-29T15:32:05Z")

</div>

Maybe not the simplest, but this works  
Skip the following if that file already contains a module:

```julia
module dummy
    include("yourFile.jl")
end

```

then

```julia
syms = names( dummy, all = true )
filter( x->getproperty(dummy,x) isa Function, syms )

```
