# Question about Revise.jl and its alternatives (if any)

**URL:** <https://discourse.julialang.org/t/question-about-revise-jl-and-its-alternatives-if-any/20858>\
**Category:** General Usage\
**Tags:** question\
**Created:** [February 16, 2019, 1:06pm UTC](https://discourse.julialang.org/t/question-about-revise-jl-and-its-alternatives-if-any/20858 "2019-02-16T13:06:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![simon](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@simon](https://discourse.julialang.org/u/simon)\
**Post date:** [February 16, 2019, 1:06pm UTC](https://discourse.julialang.org/t/question-about-revise-jl-and-its-alternatives-if-any/20858/1 "2019-02-16T13:06:41Z")

</div>

I tried to use Revise.jl to make some parameter tuning faster. However, it sometimes doesn’t work well for me, because it would not recompile the code after the modified line. Even when these code may use the variable(e.g. NT1=NT+1, or range statement based on it).

For now, I must include the file again. Is there a way to avoid the problem w/o include the file again? Or is there a Revise-like package to do the something like this?

```julia
module mymodule
NT=10 #\change NT to 20, Revise would modify this line in the background, from 10 to 20
t1=NT+1# t1 is NOT updated, still 11
t=range(0.0,stop=NT,step=1.0) # t is NOT updated
end

```

---

<div class="post-metadata">

**Author:** ![Tero\_Frondelius](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tero_frondelius/32/7629_2.png) [@Tero\_Frondelius](https://discourse.julialang.org/u/Tero_Frondelius)\
**Post date:** [February 16, 2019, 1:50pm UTC](https://discourse.julialang.org/t/question-about-revise-jl-and-its-alternatives-if-any/20858/2 "2019-02-16T13:50:15Z")

</div>

Stupid question but how did you test that other variables are not updated?

---

<div class="post-metadata">

**Author:** ![simon](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@simon](https://discourse.julialang.org/u/simon)\
**Post date:** [February 16, 2019, 2:49pm UTC](https://discourse.julialang.org/t/question-about-revise-jl-and-its-alternatives-if-any/20858/3 "2019-02-16T14:49:59Z")

</div>

I load submodules by pushing directory to load path and using submodule. I run it in Atom console.  
Tune value of NT in atom, and check by console .submodule.NT. Maybe some settings of Revise.jl are not right…

---

<div class="post-metadata">

**Author:** ![Tero\_Frondelius](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tero_frondelius/32/7629_2.png) [@Tero\_Frondelius](https://discourse.julialang.org/u/Tero_Frondelius)\
**Post date:** [February 16, 2019, 4:01pm UTC](https://discourse.julialang.org/t/question-about-revise-jl-and-its-alternatives-if-any/20858/4 "2019-02-16T16:01:20Z")

</div>

I can reproduce:

```julia
julia> using Revise

(v1.0) pkg> activate mymodule

julia> using mymodule

julia> mymodule.NT
10

julia> mymodule.t
0.0:1.0:10.0

```

Now let’s update mymodule

```julia
julia> mymodule.NT
20

julia> mymodule.t
0.0:1.0:10.0

julia> mymodule.t1
11

julia> 

```

---

<div class="post-metadata">

**Author:** ![simon](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@simon](https://discourse.julialang.org/u/simon)\
**Post date:** [February 16, 2019, 5:32pm UTC](https://discourse.julialang.org/t/question-about-revise-jl-and-its-alternatives-if-any/20858/5 "2019-02-16T17:32:06Z")

</div>

Yes, it frustrated me sometimes. So to avoid this, I disable Revise, always rerun “include(”./submodel.jl"); using .subomodel" after I modified anything. Though I wonder if it is the recommended way?  
I guess it is due to efficiency - the subsequent code may need long time to execute.

---

<div class="post-metadata">

**Author:** ![ffevotte](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ffevotte/32/6587_2.png) [@ffevotte](https://discourse.julialang.org/u/ffevotte)\
**Post date:** [February 17, 2019, 5:57pm UTC](https://discourse.julialang.org/t/question-about-revise-jl-and-its-alternatives-if-any/20858/6 "2019-02-17T17:57:58Z")

</div>

Could you put the code depending on you parameter inside a function? Revise will update the value of the parameter as you edit the file, and re-running the function will give you the correct values:

```julia
module mymodule

NT=20 #\change NT to 20

function foo()
    @show t1=NT+1
    @show t=range(0.0,stop=NT,step=1.0)
end

end

```

```julia
julia> using Revise

julia> includet("/path/to/mymodule.jl") #or "using mymodule" if the project is correctly activated

julia> mymodule.foo()
t1 = NT + 1 = 11
t = range(0.0, stop=NT, step=1.0) = 0.0:1.0:10.0
0.0:1.0:10.0

julia> # edit "mymodule.jl"

julia> mymodule.foo()
t1 = NT + 1 = 21
t = range(0.0, stop=NT, step=1.0) = 0.0:1.0:20.0
0.0:1.0:20.0

```

Would such a workflow be suitable for the task at hand?

---

<div class="post-metadata">

**Author:** ![simon](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@simon](https://discourse.julialang.org/u/simon)\
**Post date:** [February 18, 2019, 5:26pm UTC](https://discourse.julialang.org/t/question-about-revise-jl-and-its-alternatives-if-any/20858/7 "2019-02-18T17:26:30Z")

</div>

Thanks. It works for simple modification, though not very convenient.
