MathGroup Archive 2002

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

Search the Archive

Conditional evaluation

  • To: mathgroup at smc.vnet.net
  • Subject: [mg34281] Conditional evaluation
  • From: "Tim Ebringer" <drearyslig at hotmail.com>
  • Date: Mon, 13 May 2002 05:54:43 -0400 (EDT)
  • Organization: Computer Science, University of Melbourne
  • Sender: owner-wri-mathgroup at wolfram.com

Greetings gurus,

Does anyone know how to do the expression If[expr, a, b, b] using the
conditional /; operation, i.e.

myFunc[x_]:=a /; expr
myFunc[x_]:=b /; <otherwise>

I could do it using the If function, but would much prefer, for layout
reasons, to use the conditional operator, but I can't seem to make it do the
"otherwise" part. Note that !expr doesn't work in this case because it
doesn't evaluate.

Cheers,

Tim.




  • Prev by Date: Assigning to superscripted variables
  • Next by Date: Style of IN[..] and Out[..] names
  • Previous by thread: Re: Assigning to superscripted variables
  • Next by thread: Re: Conditional evaluation