I am used to starting all my Matlab scripts with
clear all; close all; clc to ensure I am not looking at any old data or plots. I found Julia’s
clearconsole() to be equivalent to Matlab’s
clc, but don’t have working solutions for the other two Matlab commands yet. I mostly work in the Juno IDE and run scripts with the Play (“Run All”) button.
I understand that the Revise.jl package is supposed to help refresh the workspace now that
workspace() is deprecated, but it doesn’t work for this simple test case. If I define
x once and then comment that line out, it will continue to print each time I run without error.
using Revise clearconsole() #x=1 println(x)
I know I can hit “Stop” then “Play” to reset the workspace. However, that still doesn’t close old plots, and the time to first plot problem makes this option undesirable.
I found the “Forget All Plots” button in Juno’s plot pane, but I would like to have that functionality as a line in my script instead. Currently, it takes me three clicks to run a script again after I edit it (four if I include “Stop”).
- “Forget All Plots”
- Somewhere in the editor to put focus back on my current file.
- “Run All”
I would ideally like to re-run in a fresh environment with one click or keystroke, but any tips on a better Juno workflow would be appreciated.