Is there a way to set what symbols's definitions I do not want to store?
Consider the following code:
f := $MachineID; SetDirectory[NotebookDirectory[]]; Save["testm.m", f]; ClearAll@f << "testm.m" f Set::specset: Cannot change the value of special symbol $MachineID. >> 0000-00000-00001 (*id of storing machine*) 0000-00000-00002 (*id of getting machine*)
This happens bacause testm.m contains:
f := $MachineID $MachineID = "0000-00000-00001"
Questions:
Is there nicer way to avoid this than my approach:
f:= Symbol["MachineID"]?
Is it
Protectedattribute which decides what is going to be stored? Because there is no problem iff:=SystemIDbut:Attributes[{$SystemID, $MachineID}]{{Locked, Protected}, {}}
Edit:
- Why
MachineIDis not protected? - The bounty is founded for this question.
$MachineIDis notProtected$\endgroup$