Mathematica 8 has conditional expressions



For those interested in looking at a design, Mathematica 8
(parts are new in version 8....)

there are sections in the manual  (which I think you can access
online without having a license)  for

Procedural Conditionals
If - test if a condition is true, false, or of unknown truth value
Which - test which of a sequence of conditions are true
Switch - switch based on a value, with patterns allowed


Mathematical Function Conditionals
Piecewise - an arbitrary piecewise function
ConditionalExpression - expression defined under condition
UnitStep  Sign  Mod Floor Boole  DiscreteIndicator ...


..................
Thus there is a separate version of a declarative conditional
for mathematical functions, different from "If".

Kind of like Maxima's  prederror:false.  Or something we
had in Tilu to return integration answers subject to conditions.


Oh, there is also a pattern-based conditional in Mathematica,
which is really "rules" for replace when a pattern matches (= condition,
I suppose).

Note also (maybe for Rich H.) the definition for piecewise
may be of interest.


RJF