MathGroup Archive 1992

[Date Index] [Thread Index] [Author Index]

Search the Archive

In and Out in Mma


          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





  • Prev by Date: Mathematica front-end on HP workstations
  • Next by Date: Re: PointSize in ListPlot
  • Previous by thread: Mathematica front-end on HP workstations
  • Next by thread: Re: In and Out in Mma