Mma In and Out
- To: MathGroup at yoda.physics.unc.edu
- Subject: Mma In and Out
- From: fransm at info.win.tue.nl (Frans Martens)
- Date: Thu, 10 Dec 92 15:41:48 +0100
An "In and Out" problem
The problem below is subtracted from a more complicated Mma problem.
Ingredients are a function f and a test testq:
In[1]:= f[a_?testq]:=aap
In[2]:= f[u]
Out[2]= f[u]
In[3]:= testq[u]=True
Out[3]= True
In[4]:= Out[2]
Out[4]= f[u] This doesn't surprise me too much.
The variable u itself hasn't changed.
In[5]:= In[2]
Out[5]= f[u] This result seems strange to me.
In[2] has a delayed value of the second input line.
The questions are:
(1) How can an inexperienced Mma user evaluate In[2] (or Out[2] ) again
in such a way that the correction ( In[3] ) is effective?
(2) Why isn't In[2] evaluated anew? What are the ideas behind this setup
of the In object?
Remark: I know that
u/: test[u]=True
would not have caused problems. But that is not the point.
Frans Martens
University of Technology Eindhoven
The Netherlands
fransm at win.tue.nl