MathGroup Archive 2006

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

Search the Archive

Re: A test with options

  • To: mathgroup at
  • Subject: [mg65471] Re: A test with options
  • From: Chris Rodgers <rodgers at>
  • Date: Mon, 3 Apr 2006 06:59:41 -0400 (EDT)
  • Organization: Oxford University, England
  • References: <> <e0lldf$779$>
  • Sender: owner-wri-mathgroup at

>>Below I create a test with an option and a function dependant upon the
>>test. As I see it the function fails to operate as I anticipated. So I
>>am missing something and need help understanding. 
>>Options[TestQ] = {EvaluationRequired -> False}; 
>>TestQ[a_] := EvaluationRequired /. Options[TestQ]; 
>>b = a1
>>(* Now I am lost. Why in a new evaluation did the function input not get
>>retested and pass the test? *)
> You need to use Update:
> In[10]:=
> Update[f]
> b=a1
> Out[11]=
> {100}

I have been bitten by this behaviour myself. As far as I could make out, 
the only way to ensure consistent evaluation in Mathematica is to run 
Update[] before every input - otherwise there's no guarantee of 
accuracy. It seems odd to me that Mathematica doesn't add e.g. variables 
mentioned in /; conditions to its list of dependencies when building the 
cache of previously evaluated results.

All the same, I realise that there may be good internal reasons for such 
behaviour. For interest, can you explain briefly why Mathematica is 
designed to ignore variables in e.g. /; conditions when building its 
internal evaluation cache?


  • Prev by Date: Re: SpeakTextPacket in 5.2
  • Next by Date: Re: Strange Det function behavior.
  • Previous by thread: Re: A test with options
  • Next by thread: Technical question from new userr