# Exported functions do not update

**URL:** <https://discourse.julialang.org/t/exported-functions-do-not-update/103725>\
**Category:** General Usage\
**Tags:** repl, workflow\
**Created:** [September 10, 2023, 5:36pm UTC](https://discourse.julialang.org/t/exported-functions-do-not-update/103725 "2023-09-10T17:36:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![A\_C](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@A\_C](https://discourse.julialang.org/u/A_C)\
**Post date:** [September 10, 2023, 5:36pm UTC](https://discourse.julialang.org/t/exported-functions-do-not-update/103725/1 "2023-09-10T17:36:49Z")

</div>

I am using the REPL workflow described in [REPL Workflow](https://docs.julialang.org/en/v1/manual/workflow-tips/#REPL-based-workflow).

Suppose the contents of Tmp.jl are as follows:

```julia
module Tmp
export say_hello

say_hello() = println("Hello!")

# your other definitions here

end

```

And the contents of tst.jl are:

```julia
include("Tmp.jl")
#import .Tmp
using .Tmp # we can use `using` to bring the exported symbols in `Tmp` into our namespace

#Tmp.say_hello()
say_hello()

# your other test code here

```

Now if I edit the `say_hello()` function and do `include('tst.jl')` the function definition is not updated in REPL. This problem goes away if I call the function as `Tmp.say_hello()`. Is this the expected behaviour?

---

<div class="post-metadata">

**Author:** ![CameronBieganek](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cameronbieganek/32/6915_2.png) [@CameronBieganek](https://discourse.julialang.org/u/CameronBieganek)\
**Post date:** [September 10, 2023, 11:54pm UTC](https://discourse.julialang.org/t/exported-functions-do-not-update/103725/2 "2023-09-10T23:54:15Z")

</div>

I think that’s expected. Here’s what I get when I run the test script after having modified `say_hello`:

```julia
julia> include("Tst.jl")
Hello!

julia> include("Tst.jl")
WARNING: replacing module Tmp.
WARNING: using Tmp.say_hello in module Main conflicts with an existing identifier.
Hello!

```

The second warning says that the new `say_hello` conflicts with the old one. So, the old definition is kept (though the new definition is still available within the new `Tmp` module).

So, I think the only realistic way to use the workflow mentioned in the manual is to `import` the `Tmp` module and use the qualified `Tmp.say_hello()` in your test script.

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [September 11, 2023, 12:02am UTC](https://discourse.julialang.org/t/exported-functions-do-not-update/103725/3 "2023-09-11T00:02:40Z")

</div>

Someone knowledgeable, please do improve this key section of the manual.

---

<div class="post-metadata">

**Author:** ![A\_C](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@A\_C](https://discourse.julialang.org/u/A_C)\
**Post date:** [September 11, 2023, 3:17am UTC](https://discourse.julialang.org/t/exported-functions-do-not-update/103725/4 "2023-09-11T03:17:55Z")

</div>

The same thing happens when using the `Revise.jl` based workflow. Though I am not sure I am doing it correctly. Maybe it must be clarified in docs.

---

<div class="post-metadata">

**Author:** ![A\_C](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@A\_C](https://discourse.julialang.org/u/A_C)\
**Post date:** [September 11, 2023, 3:26am UTC](https://discourse.julialang.org/t/exported-functions-do-not-update/103725/5 "2023-09-11T03:26:39Z")

</div>

I have created an issue [here](https://github.com/JuliaLang/julia/issues/51265).

---

<div class="post-metadata">

**Author:** ![magister-ludi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/magister-ludi/32/4003_2.png) [@magister-ludi](https://discourse.julialang.org/u/magister-ludi)\
**Post date:** [September 11, 2023, 4:06am UTC](https://discourse.julialang.org/t/exported-functions-do-not-update/103725/6 "2023-09-11T04:06:48Z")

</div>

In order for `Revise` to follow changes to the content, you need to type

```julia
includet("Tst.jl")

```

(note the **t** at the end). It’s easy to miss that the first time and I’m sure most of us have done it ☹

---

<div class="post-metadata">

**Author:** ![A\_C](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@A\_C](https://discourse.julialang.org/u/A_C)\
**Post date:** [September 11, 2023, 4:58am UTC](https://discourse.julialang.org/t/exported-functions-do-not-update/103725/7 "2023-09-11T04:58:20Z")

</div>

That works. Thanks. I had to first do `includet("Tst.jl")` and then again do `include("Tst.jl")` to execute the whole file.

I had not tried earlier with `includet` but with the Pkg centric [usage](https://timholy.github.io/Revise.jl/stable/cookbook/). There the exported functions did not seem to update. But I might have done it wrong.
