If a value is assigned to a variable that is named by capital K it cannot be deleted. This effect can be observed directly after start of the program.
Is this a bug?
If a value is assigned to a variable that is named by capital K it cannot be deleted. This effect can be observed directly after start of the program.
Is this a bug?
The Wolfram Language currently uses seven single letter capital letters for various core system functions: C, D, E, I, K, N, and O. Mnemonically: OINCKED
The other 19 capital letters are available to use, at least in current versions:
data = {#, Symbol[#], ToExpression[# <> "::usage"]} & /@ CharacterRange["A", "Z"];
Grid[data, Alignment -> Left, Frame -> All, BaseStyle -> "Text"]
Of these seven symbols, K is the only undocumented symbol (in the sense that it does not have a reference page). I would consider that a bug or shortcoming in the documentation.
CODE INK - two small meaningful words. Or maybe KODE INC an imaginary company.
– Suba Thomas
May 04 '20 at 15:42
K is part of the System` context. You were removing symbols from the Global` context only, so K wasn't affected. It could be unset with K=..
That said, when doing interactive work, avoid using any symbols whose name starts with a capital letter, as these may conflict with System symbols or package symbols.
Do not set any value for K and do not attempt to Remove it as this will break things. K is used as the summation index when a generic Sum is returned. An example from the documentation of RSolve:
RSolve[a[n + 1] == a[n] + f[n], a[n], n]
(* {{a[n] -> C[1] + Sum[f[K[1]], {K[1], 0, -1 + n}]}} *)
I do not know why K is not Protected. It seems like it would make sense to protect it as people regularly assign to it by accident.
If K is evaluated then click on "description of K" and you get information:
K is a default generic name for a summation index in a symbolic sum.
The bug is that this information is missing in the help.
Kis a built-in symbol used by internal functions as a dummy variable for integrals/products/sums, e.g.DSolve[{y'[x] == Sin[Sin[x]]}, y, x]. Of course, you can't delete it! – J. M.'s missing motivation Jan 25 '20 at 22:16?K. – J. M.'s missing motivation Jan 25 '20 at 22:34Kis left unprotected as a result of its use as a dummy variable? I think this is an easy to avoid mistake, however, and the OP shows that there is some level of advisory that pops up when you check the description. – CA Trevillian Jan 26 '20 at 05:41Cis used as a dummy variable and it isProtected. – Szabolcs Jan 26 '20 at 16:06