My understanding is that when you type x=1
in the REPL, it adds an x
binding in the Main module, it’s a bit like typing:
module Main
x = 1
end
It seems Julia keeps some sort of list of all the bindings in a module, is there a reason why we can’t remove an element from that table ? e.g. delete!(Main,:x)
.
Otherwise maybe something like REPLinModule might a workaround, to get a clean workspace you would do module Testing end
, REPLinModule.set(Testing)
and your REPL would then be evaluating in an empty module (which is more or less what workspace does, as I understand).