Post by duke
Is there a way to "clear the decks" or "wipe the slate clean" in a FL top-level - say PolyML or SML/NJ?
I make a few typos in the learning process, and I see that once something is declared - it's there for good. Short of re-starting the interpreter, is there a way to un-bind everything?
Restarting is almost instantaneous so I just do that to fully wipe the slate clean.
A more interesting requirement is to revert back to a previous state. One may want this to avoid waiting for e.g. libraries to be loaded. This is possible with Poly/ML and SML/NJ as they can save the current state of the SML session.
In Poly/ML, the command
saves the state to the file state (relative to the current directory, as given by OS.FileSys.getDir) and
loads the previously saved state state. States can also be hierarchical. See
For SML/NJ, the command
saves the current state to the file state. This is loaded by starting a new session with the command