MathGroup Archive 1999

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

Search the Archive

Re: ReplaceAll in If Statement

  • To: mathgroup at
  • Subject: [mg19489] Re: ReplaceAll in If Statement
  • From: Eckhard Hennig <hennig at>
  • Date: Sat, 28 Aug 1999 15:53:13 -0400
  • Organization: ITWM
  • References: <7q20sl$>
  • Sender: owner-wri-mathgroup at

Tom Compton schrieb in Nachricht <7q20sl$q9i at>...
>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?
>If[a /. {opts}, z=1, z=2, z=3];
>{a, z} /. {opts}]


note that your function call in In[3] evaluates to 


but what you wanted is


i.e. the argument to test must be a Sequence of rules, not a List. With

  test @@ opList

your function works correctly.

-- Eckhard

Dipl.-Ing. Eckhard Hennig      mailto:hennig at
Institut fuer Techno- und Wirtschaftsmathematik e.V. (ITWM)
Erwin-Schroedinger-Strasse,  67663 Kaiserslautern,  Germany
  Voice: +49-(0)631-205-3126    Fax: +49-(0)631-205-4139

     ITWM - Makers of Analog Insydes for Mathematica

  • Prev by Date: Stochastic Differentail equations
  • Next by Date: Re: Behavior of Array[]
  • Previous by thread: Re: ReplaceAll in If Statement
  • Next by thread: Re: ReplaceAll in If Statement