MathGroup Archive 2006

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

Search the Archive

Re: variable "K"? (Really strange behavior . . . )

  • To: mathgroup at
  • Subject: [mg69260] Re: variable "K"? (Really strange behavior . . . )
  • From: AES <siegman at>
  • Date: Mon, 4 Sep 2006 02:41:24 -0400 (EDT)
  • Organization: Stanford University
  • References: <ed6918$jho$> <> <> <edae60$qdh$> <edg8hi$gh7$>
  • Sender: owner-wri-mathgroup at

In article <edg8hi$gh7$1 at>, albert <awnl at> wrote:

> I think it should be obvious that Remove["Global`*"] is only doing almost
> what you want, and only by chance. As the documentation will tell it
> removes all symbols in the context "Global`". If you define (own)values for
> symbols in other contexts, may that be "System`" as in the case you
> mentioned or in any other context, e.g. mycontext`var = 5, these will not
> be removed, and there is no reason to believe they should. Nothing wrong
> with Mathematica, I think. 

Not to argue or quarrel here, just to comment.  I'd suggest that an 
"ordinary user" (whatever that may mean -- perhaps "someone who was 
trained and works in another field of engineering, science, business, 
statistics, you name it, and just uses Mathematica as a tool") can do an 
immense amount of productive, useful, and successful work in 
Mathematica, including using many of Mathematica's most powerful 
numerical and graphics tools, without *ever* hearing about -- much less 
coming to understand -- the concept of "context" in the Mathematica 

[And if "Remove[**"GLOBAL`*"**]" doesn't at least imply that it's 
removing everything that's around to be removed, well . . . ]

> The fact that variable names starting with uppercase letters can conflict
> with internal names is well known and documented. 

Yes -- depending on how deeply someone digs into the documentation.  
After all, some people might want to just turn on Mathematica **and 
start *using* it to do useful work**.

And, as I noted in another post, there seem to be at present seven cap 
letters that are currently used as symbols in the System context.  Six 
of these are documented as such in the Help system, and produce an error 
flag if you try to assign a value to them.  One of them -- K, of course 
-- does *neither* of those helpful things (and all of the other 19 cap 
letters seem to work just fine -- currently at least -- as user 

> If for readability you
> want to use short uppercase letters for variable names, I would suggest to
> use the script-Letters. These you can input from a palette or with
> Esc-scA-Esc for a script capital A. I use this all the time and have never
> had problems with it.

Useful idea -- will explore.

> For cleanup of the kernel you should check the package CleanSlate`, because
> that AFAIK has been made to provide the functionality you are "misusing"
> Remove["Globals*"] for. If CleanSlate` will not cleanup System`-Variables
> that have been changed, than you could ask the author of that package (Todd
> Gayley I think) to include such a functionality or provide it yourself.

Always wondered why the core concept of CleanSlate wasn't built into 
Mathematica from the start.  If I want the CleanSlate functionality, the 
choices seem to be:

1)  Shut down and restart Mathematica.

2)  Do a bunch of learning and testing to discover and understand all 
the Remove[] and Clear[] commands I need to give to accomplish the same 
thing (in essence, write my own CleanSlate).

3)  Acquire CleanSlate --- which I did once, a while back; discovered it 
didn't seem to be -- at that time anyway -- just a "click the button" 
process, but seemed to have its own learning curve and complexities; and 
tossed it.

Over and out on this topic . . . 


  • Prev by Date: Re: comboboxes and paste to notebook
  • Next by Date: Re: Re: variable "K"? (Really strange behavior . . . )
  • Previous by thread: Re: Re: variable "K"? (Really strange behavior . . . )
  • Next by thread: Re: Re: variable "K"? (Really strange behavior . . . )