[Date Index] [Thread Index] [Author Index]
Re: Quit versus Clear["Global`*"]
On 9/4/11 at 6:06 PM, tmatsoukas at me.com (Themis Matsoukas) wrote: >So, if I use ClearAll["Global`*"] at the beginning of a notebook and >execute all the cells, is it the same as running on a fresh kernel? No. This will not reset the evaluation history. Nor will it remove any packages you may have loaded That is: In:= x = 4 Out= 4 In:= y = x^2 Out= 16 In:= ClearAll["Global`*"] In:= %1 + %2 Out= 20 The closest way I know of to reset things to the initial start up condition is to put a directive to load the CleanSlate package into init.m. Then after a series of evaluations you can do CleanSlate which resets things to the point where the CleanSlate package was loaded. The last three lines of my init.m are: <<PacletManager`; <<Utilities`CleanSlate`; SetOptions[CleanSlate,Verbose->False]; I explicitly load the PacletManager since I found in earlier versions of Mathematica, the PackletManager was loading after everything in init.m executed. I have not tested ver 8 to see if this is still true. Assuming it is still true, if the PackletManager is not loaded explicitly in this manner it will be removed when CleanSlate is executed.