# Using a function without defining it in the code, but placing it in the current directory

**URL:** <https://discourse.julialang.org/t/using-a-function-without-defining-it-in-the-code-but-placing-it-in-the-current-directory/42520>\
**Category:** New to Julia\
**Created:** [July 4, 2020, 12:08pm UTC](https://discourse.julialang.org/t/using-a-function-without-defining-it-in-the-code-but-placing-it-in-the-current-directory/42520 "2020-07-04T12:08:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nash](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nash/32/14482_2.png) [@Nash](https://discourse.julialang.org/u/Nash)\
**Post date:** [July 4, 2020, 12:08pm UTC](https://discourse.julialang.org/t/using-a-function-without-defining-it-in-the-code-but-placing-it-in-the-current-directory/42520/1 "2020-07-04T12:08:27Z")

</div>

Functions in MATLAB can be saved in the current directory and called without explicitly defining them again in the current code. Is that possible in Julia?

---

<div class="post-metadata">

**Author:** ![tomaklutfu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomaklutfu/32/2411_2.png) [@tomaklutfu](https://discourse.julialang.org/u/tomaklutfu)\
**Post date:** [July 4, 2020, 12:33pm UTC](https://discourse.julialang.org/t/using-a-function-without-defining-it-in-the-code-but-placing-it-in-the-current-directory/42520/2 "2020-07-04T12:33:24Z")

</div>

Julia does not know anything about the code in the current folder until you `include` them in the code.  
If you save a function in a file called `fun.jl` you can load it with `include("fun.jl")`.

---

<div class="post-metadata">

**Author:** ![Henrique\_Becker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrique_becker/32/15443_2.png) [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)\
**Post date:** [July 4, 2020, 1:19pm UTC](https://discourse.julialang.org/t/using-a-function-without-defining-it-in-the-code-but-placing-it-in-the-current-directory/42520/3 "2020-07-04T13:19:55Z")

</div>

To complement, you probably could mimic this behavior by changing your Julia startup file to look at any `.jl` files in the folder it was called and proactively including them.
