Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mathematica: How to prevent evaluation of In[-1]?

When I'm trying to get last input expression in Wolfram Mathematica 5.2 using In[-1] I get evaluated output:

In[1]:= On[In]
2 + 2
In[-1]

Out[2]= 4

During evaluation of In[1]:= In::trace: In[-1] --> In[$Line-1]. >>

During evaluation of In[1]:= In::trace: In[$Line-1] --> In[2]. >>

During evaluation of In[1]:= In::trace: In[2] --> 2+2. >>

Out[3]= 4

How can I get the input expression in unevaluated form?

like image 987
Alexey Popkov Avatar asked Feb 25 '23 01:02

Alexey Popkov


1 Answers

You could try InString[]

In[1]:= 2 + 2
Out[1]= 4

In[2]:= InString[-1]
Out[2]= "\\(2 + 2\\)"
like image 165
Simon Avatar answered Mar 21 '23 05:03

Simon