Question
Is there a way to define a function which evaluates itself regardless of HoldAll, HoldFirst, ... ?
Background
I'm writing a function which makes it easier to document other functions using ::usage, SyntaxInformation and code completion. I also use code generation and I want to document the generated code.
Therefore I need to define new symbols with a usage message and remove them like this:
(* I already get an error message here since `Evaluate` wants to evaluate `Symbol[name]` but `name` is not a string yet *) NewSymbol[name_String] := Evaluate[Symbol[name]]; Remove[NewSymbol["test"]] (* DOES NOT WORK *) NewSymbol["test"]::usage = "This is a test"; (* DOES NOT WORK *) (* In order to make it work I have to use an additional `Evaluate`*) (* The same is true if I want to use `Remove` *) Remove[Evaluate[NewSymbol["test"]]] Evaluate[NewSymbol["test"]]::usage = "This is a test"; 