Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #4827
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!goblin2!goblin1!goblin.stu.neva.ru!uio.no!newsfeeds.sol.net!post2.nntp.sol.net!posts.news.twtelecom.net!nnrp3.twtelecom.net!not-for-mail |
|---|---|
| From | Bill Rowe <readnews@sbcglobal.net> |
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Quit versus Clear["Global`*"] |
| Date | Thu, 8 Sep 2011 09:27:35 +0000 (UTC) |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Sender | steve@smc.vnet.net |
| Approved | Steven M. Christensen <steve@smc.vnet.net>, Moderator |
| Message-ID | <j4a1q7$41o$1@smc.vnet.net> (permalink) |
| Lines | 38 |
| NNTP-Posting-Date | 08 Sep 2011 08:30:27 GMT |
| NNTP-Posting-Host | 47ec0d9b.news.twtelecom.net |
| X-Trace | DXC=a?GHcN^VkSd^7<OLPF>_YaC_A=>8kQj6m=_1NR_H?JPmQBDiL;l98VkEFiONJ7[GofRggY3ZU@aHa |
| X-Complaints-To | abuse@twtelecom.net |
| Xref | x330-a1.tempe.blueboxinc.net comp.soft-sys.math.mathematica:4827 |
Show key headers only | View raw
On 9/7/11 at 5:42 AM, Kevin.McCann@umbc.edu (Kevin J. McCann) wrote: >Actually the code was just an example. I teach a class in >Mathematica, and I would like the students to put a Quit at the top >of each homework they turn in; so, then I can just select all and >execute. The Quit would, of course, wipe out all previously defined >things, so we start with a clean slate. Apparently, though, this >won't work for the aforementioned reasons. My method of achieving a clean slate to work with is as follows: The last lines of my init.m file are as follows: <<PacletManager`; <<Utilities`CleanSlate`; SetOptions[CleanSlate,Verbose->False]; The last line simply sets some options for CleanSlate I like. The line before obviously loads the CleanSlate package. The first line intentionally loads the PacletManager before the CleanSlate package because I found this was loading after commands in init.m were executing. With this, simply doing CleanSlate[]; prior to executing any commands in a notebook clears the Global context, removes any packages loaded after the CleanSlate package was loaded and resets the session history. That is, this restores things to what they were when I first started a Mathematica session without actually quitting the kernel. I find this to be a very handy utility which is why I have it loaded in my init.m file
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: Quit versus Clear["Global`*"] Bill Rowe <readnews@sbcglobal.net> - 2011-09-08 09:27 +0000
csiph-web