MathGroup Archive 2006

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

Search the Archive

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

  • To: mathgroup at smc.vnet.net
  • Subject: [mg69260] Re: variable "K"? (Really strange behavior . . . )
  • From: AES <siegman at stanford.edu>
  • Date: Mon, 4 Sep 2006 02:41:24 -0400 (EDT)
  • Organization: Stanford University
  • References: <ed6918$jho$1@smc.vnet.net> <200609011041.GAA25571@smc.vnet.net> <acbec1a40609010800w611c1bc2h322f089ea527b535@mail.gmail.com> <edae60$qdh$1@smc.vnet.net> <edg8hi$gh7$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

In article <edg8hi$gh7$1 at smc.vnet.net>, albert <awnl at arcor.de> 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 
sense.

[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 
variables).


> 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 . . . 

   --AES


  • 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 . . . )