TransWikia.com

ClearAll required twice on a symbol with SyntaxInformation

Mathematica Asked on July 4, 2021

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?

One Answer

It's a bug. From Wolfram Technical Support: "I have reproduced the issue and have reported it to our developers."

Workaround, from the comments by Lukas Lang: SyntaxInformation[f]=.; ClearAll[f] or Quiet[Unset@*SyntaxInformation@*Symbol /@ Names["`*"]]; ClearAll["`*"].

Correct answer by Blrp on July 4, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP