I typed and evaluated an expression, but deleted it from the notebook. For instance, suppose it was
In[1]:= Round@SessionTime[]
Out[1]= 2
I now want to retrieve the input so that I can edit it again.
I know Mathematica keeps the history of evaluated expressions in In. But if I try to access it directly In[123], rather than giving the unevaluated input expression, it evaluates it again:
In[2]:= In[1]
Out[2]= 10
If I use Hold to suppress evaluation, then In[...] doesn't get evaluated, so I don't see the input:
In[3]:= Hold[In[1]]
Out[3]= Hold[In[1]]
How can I retrieve the input expression in an editable form, without evaluating it?
In[6]:= ToExpression[InString[1], StandardForm, Defer], I getOut[6]:= RowBox[{"ToExpression", "[", RowBox[{RowBox[{"InString", "[", "5", "]"}], ",", "StandardForm", ",", "Defer"}], "]"}]. I don't want all thoseRowBox's and whatnot. What I actually want isOut[6]:= ToExpression[InString[1], StandardForm, Defer](perhaps wrapped with some sort ofHold-like container.) – Jess Riedel Mar 21 '16 at 20:58