MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: ClearAll ?? or what

  • To: mathgroup at smc.vnet.net
  • Subject: [mg102835] Re: ClearAll ?? or what
  • From: Peter Breitfeld <phbrf at t-online.de>
  • Date: Fri, 28 Aug 2009 05:43:48 -0400 (EDT)
  • References: <h7371j$b28$1@smc.vnet.net> <h75nba$p3g$1@smc.vnet.net> <h77nb8$s5d$1@smc.vnet.net>

To suppress globally the warning message, you may add the line

Off[Remove::rmnsm]

to your $UserBaseDirectory/Kernel/init.m  file.

AES wrote:

F> In article <h75nba$p3g$1 at smc.vnet.net>,
>  Armand Tamzarian <mike.honeychurch at gmail.com> wrote:
>
>> Remove["Global'*"]
>> or
>> If[Length[Names["Global`*"]] > 0, Remove["Global`*"]];
>> so as to avoid the message of no Global symbols exist.
>
> The point here is that you might routinely put
>
>    Remove["Global'*"]
>
> as the first line in all of your freestanding notebooks, so that any 
> time you open a new notebook or edit something in an existing notebook, 
> then do a Select All and Enter to execute that notebook, you will have 
> something like a "clean start" for that execution.
>
> The problem (a minor one) is that if you do this, then the first time 
> you execute such a notebook in a newly opened Mathematica session, you 
> will get the "error" message:
>
>    Remove::rmnsm: There are no symbols matching "Global`*". >>
>
> I put "error" in quotes here because (a) so far as I can see you haven't 
> really damaged anything by doing this, and (b) this shouldn't be called 
> an error in any case, at least if you live by the standard computer 
> science wildcard convention that "the asterisk character ("*") 
> substitutes for any zero or more characters".
>
> The history is that doing this wasn't an error through several early 
> versions of Mathematica.  It became an error sometime around v4? 
> or v5?.  Why? -- who knows?
>
> The solution, so far as I can see, is to use
>
>    x; Remove["Global'*"]
>
> as the first line in all your notebooks.  Can this do any harm?
>

-- 
_________________________________________________________________
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de


  • Prev by Date: Re: accumulate coefficients of a polynomial
  • Next by Date: Re: ClearAll ?? or what
  • Previous by thread: Re: ClearAll ?? or what
  • Next by thread: Re: ClearAll ?? or what