SyntaxInformation[f] = {"ArgumentsPattern" -> {}};
f[] := 0;
After one ClearAll[f]
or ClearAll["`*"]
, f
remains black. It takes two to turn f
blue, and it can't be in the same cell: just running ClearAll[f];ClearAll[f]
is not enough. Yet one ClearAll
is enough to clear FullDefinition[f]
.
In fact, the line f[] := 0;
is extraneous; all that's needed is to define SyntaxInformation[f]
.
Is this a bug? Is there anything I can run once to turn everything blue?
SyntaxInformation[f]=.; ClearAll[f]
$\endgroup$ClearAll["`*"]
? $\endgroup$Quiet[Unset@*SyntaxInformation@*Symbol /@ Names["`*"]]
should do the job $\endgroup$