4
$\begingroup$
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?

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