Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #4791

Re: Quit versus Clear["Global`*"]

From "Kevin J. McCann" <kjm@KevinMcCann.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Quit versus Clear["Global`*"]
Date 2011-09-06 08:07 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <j44kcp$96n$1@smc.vnet.net> (permalink)
References <201109042206.SAA21533@smc.vnet.net> <j42b3a$rrv$1@smc.vnet.net>

Show all headers | View raw


This is a related observation to the use of Quit.

I have an initialization cell at the top of most of my notebooks that 
loads my favorite packages and sets options. If I put Quit at the top of 
all that, and then execute the whole section, the Quit seems to override 
everything, i.e. at the end nothing is defined.

It appears that while Quit is executing, the other commands do, but then 
the Quit kills off the results. I am not explaining it well, so here is 
some abbreviated code from one of my nb's. Dump it all into an Input 
cell and execute. At the end you will see that x is not defined.

Kevin

Quit
Off[General::spell];
Off[General::spell1];
bs = {FontFamily -> "Arial", FontSize -> 14, FontWeight -> Bold};
SetOptions[Plot,
   	Frame -> True,
   	FrameStyle -> AbsoluteThickness[2],
   	GridLines -> Automatic,
   	PlotStyle -> {{Red, AbsoluteThickness[3]}, {Black,
      AbsoluteThickness[3]}, {Blue,
      AbsoluteThickness[3]}, {Darker@Green, AbsoluteThickness[3]}},
   BaseStyle -> bs
   ];
SetOptions[ListPlot,
   	Frame -> True,
   	FrameStyle -> AbsoluteThickness[2],
   	GridLines -> Automatic,
   	PlotStyle -> {Blue, AbsolutePointSize[2]},
   BaseStyle -> bs
   ];
$Post := (If[MatrixQ[#], MatrixForm[#], #] &)
x = 22/7.;

On 9/5/2011 7:16 AM, DrMajorBob wrote:
> No. For that, you need:
>
> Quit
>
> Bobby
>
> On Sun, 04 Sep 2011 17:06:32 -0500, Themis Matsoukas<tmatsoukas@me.com>
> 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?
>>
>> Themis
>>
>
>

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Quit versus Clear["Global`*"] DrMajorBob <btreat1@austin.rr.com> - 2011-09-05 11:16 +0000
  Re: Quit versus Clear["Global`*"] DrMajorBob <btreat1@austin.rr.com> - 2011-09-06 08:04 +0000
    Re: Quit versus Clear["Global`*"] "Kevin J. McCann" <Kevin.McCann@umbc.edu> - 2011-09-07 09:50 +0000
  Re: Quit versus Clear["Global`*"] "Kevin J. McCann" <kjm@KevinMcCann.com> - 2011-09-06 08:07 +0000
  Re: Quit versus Clear["Global`*"] "Kevin J. McCann" <kjm@KevinMcCann.com> - 2011-09-07 09:44 +0000
  Re: Quit versus Clear["Global`*"] DrMajorBob <btreat1@austin.rr.com> - 2011-09-07 09:41 +0000
    Re: Quit versus Clear["Global`*"] "Kevin J. McCann" <Kevin.McCann@umbc.edu> - 2011-09-07 12:30 +0000
  Re: Quit versus Clear["Global`*"] DrMajorBob <btreat1@austin.rr.com> - 2011-09-08 09:30 +0000

csiph-web