Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

RE: Can't Remove[] variable "K"? (Really strange behavior . . . )

  • To: mathgroup at smc.vnet.net
  • Subject: [mg69167] RE: [mg69131] Can't Remove[] variable "K"? (Really strange behavior . . . )
  • From: "Tony Harker" <a.harker at ucl.ac.uk>
  • Date: Thu, 31 Aug 2006 04:40:01 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

The answer seems to be that K's Context is System, not Global, and unlike
many System symbols it is not Protected, which is why it could be set to
0.6. In fact, of the 1984 symbols in System (in version 5.2)  515 are not
protected, and K is one of those:
  Length[Select[Names["System`*"], FreeQ[Attributes[#], Protected] &]]
Luckily, things like Pi, E and I are protected!

   Tony


Dr A.H. Harker
Department of Physics and Astronomy
University College London
Gower Street
London
WC1E 6BT

 

]->-----Original Message-----
]->From: AES [mailto:siegman at stanford.edu] 
To: mathgroup at smc.vnet.net
]->Subject: [mg69167] [mg69131] Can't Remove[] variable "K"? (Really 
]->strange behavior . . . )
]->
]->For years I've started every notebook with the input line
]->
]->   x; Remove["Global`*"];
]->
]->so every calculation will start more or less "fresh".  
]->Recently a calculation exhibited weird behavior involving a 
]->variable "K", which 
]->didn't seem to get removed or cleared by Remove[].   I 
]->eventually boiled 
]->this down to a simple free-standing 5 Input cell notebook as 
]->follows:  
]->
]->   x; Remove["Global`*"];
]->   K=0.6;
]->   Remove["Global`*"];
]->         Remove::"rmnsm" 
]->         There are no  symbols matching "Global`*".   More©
]->   K
]->         0.6
]->   ??K
]->         K is a default generic name for a summation index 
]->in a symbolic 
]->         sum.
]->         K = 0.6
]->
]->Notes:
]->
]->1)  This is on a Mac iBook G4, OS 10.3.9, Mathematica 5.1.0.0.
]->
]->2)  Each single-indent line is an Input cell; double-indent 
]->lines are Output cells.  Behavior repeats the same after 
]->re-typing all the cells into a fresh notebook; after 
]->quitting and re-starting Mathematica; after shutting down 
]->and restarting the Mac.
]->
]->3)  I appreciate that user variables preferably start with 
]->lower case -- but other single-cap-letter symbol names work 
]->OK, and doing Help on "K" 
]->brings up nothing special associated with K by itself.
]->
]->[And by the way, how can one select a sequence of cells in a 
]->notebook and copy all their contents -- including error msgs 
]->-- to paste in as above, without having to retype most of the stuff?)
]->
]->


  • Prev by Date: Re: General--Exponential simplifications by default
  • Previous by thread: Re: Can't Remove[] variable "K"? (Really strange behavior . . . )
  • Next by thread: RE: "Anti-Comments"?