I have a script that uses a global variable. When experimenting I run the script via julia REPL by writing include(“myscript.jl”). This works fine the first time, but the second time I always get the message “WARNING: redefinition of constant my_global_variable. This may fail, cause incorrect answers, or produce other errors.” I can understand this error since the global variable is already in memory and me running include again just reloads a copy of same variable. Is there a command in the REPL allowing me to reset everything before I run include(“myscript.jl”) (except for the obvious solution of closing the REPL)?
oheil
2
You are looking for
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Reset REPL when testing a module | 1 | 1351 | November 21, 2018 | |
| What does this error message mean | 7 | 728 | May 11, 2020 | |
| The Julia REPL: How clean environment variables. VSCODE | 5 | 2092 | May 19, 2021 | |
| Hello everybody, and a question on REPL | 2 | 473 | January 9, 2020 | |
| Reloading by re-executing include() doesn't seem to work | 4 | 519 | August 17, 2020 |