# How to list names of functions in a script file using Pluto?

**URL:** <https://discourse.julialang.org/t/how-to-list-names-of-functions-in-a-script-file-using-pluto/117809>\
**Category:** New to Julia\
**Tags:** pluto, scripting\
**Created:** [August 4, 2024, 3:10pm UTC](https://discourse.julialang.org/t/how-to-list-names-of-functions-in-a-script-file-using-pluto/117809 "2024-08-04T15:10:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![PeX](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pex/32/49986_2.png) [@PeX](https://discourse.julialang.org/u/PeX)\
**Post date:** [August 4, 2024, 3:10pm UTC](https://discourse.julialang.org/t/how-to-list-names-of-functions-in-a-script-file-using-pluto/117809/1 "2024-08-04T15:10:36Z")

</div>

Hi all,  
I have a file named `functions.jl` which I import into a Pluto notebook using  
`include("scripts/functions.jl")`.

I want to list all the function names in the functions file, what is the best practice to do it?

Thank you !

---

<div class="post-metadata">

**Author:** ![abraemer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abraemer/32/51403_2.png) [@abraemer](https://discourse.julialang.org/u/abraemer)\
**Post date:** [August 5, 2024, 8:38am UTC](https://discourse.julialang.org/t/how-to-list-names-of-functions-in-a-script-file-using-pluto/117809/2 "2024-08-05T08:38:32Z")

</div>

Files do not correspond to an organisational structure in Julia and is purely up to the programmer.  
Put the functions into a module, e.g. like

```julia
module MyFunctions
    include("scripts/functions.jl")
end
using .MyFunctions

```

then you can query like `MyFunctions.<autocomplete shows possible functions>`.  
Just written like this, you accessing the functions _requires_ the full qualification with the module’s name. Use `export functionname` to remove the need for qualification.

---

<div class="post-metadata">

**Author:** ![PeX](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pex/32/49986_2.png) [@PeX](https://discourse.julialang.org/u/PeX)\
**Post date:** [August 7, 2024, 1:00am UTC](https://discourse.julialang.org/t/how-to-list-names-of-functions-in-a-script-file-using-pluto/117809/3 "2024-08-07T01:00:15Z")

</div>

Thank you, just so I can completely understand, the snippet you show goes into the notebook right? and Then whenever I use one of the functions from the file I need to type `MyFunctions.<function name>` ?

---

<div class="post-metadata">

**Author:** ![abraemer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abraemer/32/51403_2.png) [@abraemer](https://discourse.julialang.org/u/abraemer)\
**Post date:** [August 7, 2024, 4:33am UTC](https://discourse.julialang.org/t/how-to-list-names-of-functions-in-a-script-file-using-pluto/117809/4 "2024-08-07T04:33:55Z")

</div>

Yes that’s one way.  
Preferrably you’d make the file itself a module:  
In `scripts/functions.jl`:

```julia
module MyFunctions
# export foo, bar # optionally export some names
...
end

```

In the notebook:

```julia
begin
    include("scripts/functions.jl")
    using .MyFuncions
end

```

Then you can:

- use the exported functions directly
- find all functions with `MyFunctions.<Tab>`
- use not exported functions with `MyFunctions.notexported()`

---

<div class="post-metadata">

**Author:** ![PeX](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pex/32/49986_2.png) [@PeX](https://discourse.julialang.org/u/PeX)\
**Post date:** [August 7, 2024, 5:00am UTC](https://discourse.julialang.org/t/how-to-list-names-of-functions-in-a-script-file-using-pluto/117809/5 "2024-08-07T05:00:35Z")

</div>

Great answer! Thank you so much!
