MathGroup Archive 2006

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

Search the Archive

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

  • To: mathgroup at
  • Subject: [mg69217] Re: [mg69182] Re: variable "K"? (Really strange behavior . . . )
  • From: AES <siegman at>
  • Date: Fri, 1 Sep 2006 18:41:33 -0400 (EDT)
  • References: <ed6918$jho$> <> <>
  • Sender: owner-wri-mathgroup at

At 10:00 AM -0500 9/1/06, Chris Chiasson wrote:
>They probably didn't protect K because it is usually only associated
>with some type of automatic output - such as an integration dummy
>variable. Even then, it usually appears in a unique form like K$12312.
>I think it would be okay for you to assign K a value if you wanted to.

Oh, you can assign a value to K all right, and it seems to function 
just fine as a "normal" Mathematica variable or symbol.

The problem arises if it's your practice (as it is mine) to start 
your notebooks with Remove["Global`*"] as the first Input cell, and 
then define various functions and modules in the immediately 
following cells, carefully avoiding assigning any numerical values to 
any symbols or parameters in those functions and modules until after 
all those definitions have all been completed.

Many of the symbols or parameters in those functions or modules will, 
of course be given numerical values further down in the notebook, 
when you run specific cases, but starting the notebook with 
Remove["Global`*"]  means (or *should* mean) that if you run the 
notebook once, then re-run it from the top, the initial functions and 
modules will not be contaminated by numerical values assigned in the 
previous run.

The problem is, K is apparently *not* cleared out by 
Remove["Global`*"], and no warning of this is given; and hence if 
you've used K as a variable in these initial definitions, the value 
of K from the previous run is "hard-wired" into the initial 
definitions on the following run -- whether that's what you intended 
or not.

  • Prev by Date: Re: the ellipse and the circle
  • Next by Date: Re: Re: variable "K"? (Really strange behavior . . . )
  • Previous by thread: Re: variable "K"? (Really strange behavior . . . )
  • Next by thread: Re: Re: variable "K"? (Really strange behavior . . . )