# Convert a symbol name to a Symbol and pass it as an argument to a HoldAll function unevaluated [duplicate]

ClearAll[holdingFunction];
SetAttributes[holdingFunction, HoldAll];
holdingFunction[a_] := Print[FullForm[Hold[a]]]; (* Actual implementation is different *)

ClearAll[evaluateOneStep];
evaluateOneStep[expr_] := (* Some magic *);

ClearAll[invokeHoldingFunction];
invokeHoldingFunction[symbolName_String] :=
holdingFunction[evaluateOneStep[Symbol[symbolName]]];

ClearAll[fail];
fail := Abort[];


I need to find such an implementation for evaluateOneStep so that, for example, invokeHoldingFunction["fail"] prints Hold[fail] — I need only the symbol itself to be constructed from its name, but no definition that may exist for it to be applied until the function holdingFunction decides to ReleaseHold. Could you please suggest how to do this?

• Check the third argument of ToExpression – Rojo Jun 16 '13 at 1:39
• As for the "one step" issue, see (334). – Oleksandr R. Jun 16 '13 at 1:52
• To make the advice of @Rojo more explicit, you need invokeHoldingFunction[symbolName_String]:= ToExpression[symbolName,InputForm,holdingFunction]. – Leonid Shifrin Jun 16 '13 at 1:57