# How to I force re-definition of a function in memory?

**URL:** <https://discourse.julialang.org/t/how-to-i-force-re-definition-of-a-function-in-memory/1997>\
**Category:** New to Julia\
**Tags:** question, juno, jump\
**Created:** [February 9, 2017, 9:51am UTC](https://discourse.julialang.org/t/how-to-i-force-re-definition-of-a-function-in-memory/1997 "2017-02-09T09:51:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sylvaticus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sylvaticus/32/203883_2.png) [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Post date:** [February 9, 2017, 9:51am UTC](https://discourse.julialang.org/t/how-to-i-force-re-definition-of-a-function-in-memory/1997/1 "2017-02-09T09:51:33Z")

</div>

Hello,  
I have a JuMP script of this type:

```julia
using JuMP
function myModel(α)
 ...model definition, solving and printing results..
end
mymodel(α)

```

When I change myModel() function however Juno doesn’t recognise the change and reload it, even if I select “run script”, that is the old myModel() function object remains in the memory.  
I did try to put a workspace() at the beginning of my script, but then JuMP complains in the solve() function.  
Following [https://github.com/JuliaLang/julia/issues/2385](https://github.com/JuliaLang/julia/issues/2385) I did try `clear(myModel)` but I got the error `UndefVarError: clear not defined`.

So, how can I force in Juno a function that has been already loaded in memory to be loaded again, without stopping/restarting Julia every times ?

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [February 9, 2017, 12:37pm UTC](https://discourse.julialang.org/t/how-to-i-force-re-definition-of-a-function-in-memory/1997/2 "2017-02-09T12:37:09Z")

</div>

On 0.5, use anonymous functions:

```julia
myModel = function(a)
...
end

```

On 0.6, it should work.
