Protected
Values of Protected
symbols cannot be modified:
Attributes[p] = {Protected};
p = 2;
f[p] ^= 3;
Format[p] = "text";
However, attributes might still be set:
SetAttributes[p, Flat]
Attributes[p]
Thus, you can easily remove the attribute Protected
:
Attributes[p] = {};
p = 2
You can also use Protect
or Unprotect
, resp.
Protect[p]
Attributes[p]
Unprotect[p]
If a symbol is Protected
and Locked
, it can never be changed again:
SetAttributes[p, {Protected, Locked}]
p = 2
Unprotect[p]