Sorry for another stupid question.
In a Julia program, or a function, if some ‘Oops’ happens, I know that I can put
exit()
somewhere in the code, so that I can automatically and completely shutting down julia and quit.
I mean like, in the windows CMD, doing exit() it will completely quit Julia. In Jupyter Notebook, doing exit() will shutting down the Julia kernel.
Like, once Julia is in the environment variable, in CMD I can type julia and enter REPL,
C:\Users\Trump>julia
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.5.4 (2021-03-11)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
Now if I type, exit(), it just complete quit,
julia> exit()
C:\Users\Trump>
Is there a way to quit however still in the REPL environment? Like
julia> somecommand()
julia>
I know there are some other guys might have asked similar question, but the answer is not very clear.
- I just wonder, in Julia, is there a command such that one can quit, but do not completely shutting down Julia?
Or is it by design that Julia only allow a complete exit?
However, this is also reasonable, because if it is a complete exit, all the workspace will be cleaned, and this is actually reasonable.
- Is there a command which can completely clean the workspace (remove all the variables, definitions of functions, just delete everything) without quit the REPL?
I mean like, just say in Jupyter Notebook, currently if I want to completely clean the workspace, I need to restart the kernal. Although restarting the kernal is fast, I believe there might be smarter ways to clean the workspace.
Thanks in advance!