Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1992
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1992

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

Search the Archive

In and Out in Mma

  • To: mathgroup at yoda.physics.unc.edu
  • Subject: In and Out in Mma
  • From: fransm at info.win.tue.nl (Frans Martens)
  • Date: Tue, 8 Dec 92 16:17:46 +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





  • 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