Why doesn't the following simple code reset K[r]?
In[1]:=$Context
K[r]=4r;
Clear["Global`*"];
K[r]
Out[1]=Global`
Out[4]=4r
If I use, say, A[r] or B[r] instead of K[r], they get cleared. Just not K[r].
Why doesn't the following simple code reset K[r]?
In[1]:=$Context
K[r]=4r;
Clear["Global`*"];
K[r]
Out[1]=Global`
Out[4]=4r
If I use, say, A[r] or B[r] instead of K[r], they get cleared. Just not K[r].
Share Improve this question asked Jan 18 at 19:13 matrixbudmatrixbud 1335 bronze badges 1- Thank you, Bill. I figured there was something strange about K even though it isn't listed as a reserved symbol. You might write this up as an answer. – matrixbud Commented Jan 19 at 3:28
1 Answer
Reset to default 2It appears that there is something special about the symbol K
If you exit and restart Mathematica and then type
?K
followed by the Enter key then that returns
K is a default generic name for a summation index in a symbolic sum.
If you repeat exactly those steps with A or B that shows
Missing[UnknownSymbol, A]
Maybe that has something to do with what you are seeing, but I have not been able to find something in the documentation that exactly describes this.
This shows me again why I never name anything of mine beginning with a capital letter.