MathGroup Archive 1999

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

Search the Archive

ReplaceAll in If Statement


In the following sequence I expected z to evaluate to 1 in the
Module.  It appears that the test in the module does not
evaluate to either True or False.  I don't understand why.
Can anyone explain?

In[1]:=
opList={a->True};

In[2]:=
test[opts___]:=Module[{},
If[a /. {opts}, z=1, z=2, z=3];
{a, z} /. {opts}]

In[3]:=
test[opList]
Out[3]=
{{True,3}}



Tom Compton




  • Prev by Date: Mathematica on linux help
  • Next by Date: Quick Question: Get part of the plot
  • Previous by thread: Mathematica on linux help
  • Next by thread: Re: ReplaceAll in If Statement