The removal of
workspace() is a major change that seems to have been done without much discussion (Rationale for the removal of workspace()?, 25046, 10351, 22434). The suggested replacement, Revise.jl, might be good for module developers and such use cases, but it’s not at all convenient for the type of exploratory coding and data analysis that’s common in scientific computing.
Often at the beginning of a project, I use the REPL to play around with the data and try out transformations, take different paths and circle in to the actual code to be written. Once I have a mental picture of the code, then I transfer that to a program file and then continue on with debugging, optimization, etc. Being able to clear the workspace between different stages of this is really convenient to make sure old variables and function definitions don’t interfere in the current stage of exploration. Things like Matlab’s
clear all and the old
workspace() are quite useful for this.
Moving this to an external module itself seems like a step backward, but Revise not even a full replacement. It might be theoretically possible to use Revise.jl for this kind of workflow using a scratch .jl file and tracking that (at least when/if Revise is able to deal with lambdas, macros, outdated method definitions, etc.), but that’s similar to saying we don’t need an REPL because we can create scratch files and run those with Julia - the difference in speed and convenience (and not having to switch contexts to an editor) make a qualitative difference in practice.
Is it possible to bring
workspace() back? Or, if
workspace() itself is too much of a pain to implement, can we have a
clear(...) type function/macro to clear particular method definitions, constants, variable bindings (this would be a convenience over for eg. setting the variable to
nothing), etc. by specifying them by name?