### 5.89 If

• If( <condition1>, <expression1>, ..., <conditionN>, <expressionN> [, else] ) or Si( <condition1>, <expression1>, ..., <conditionN>, <expressionN> [, else] ).
• Description: the function evaluates <condition1>. A condition is an expression whose result must be 0 [for False] or 1 [for True], else it fails and the function returns Nil. If the condition returns 1 then the function avaluate the <expression1> and returns the result, If it is 0, it evaluate the <condition2>, if it returns 1 then the function evaluate the <expression2>, else ...etc. When none of the conditions is true, the function evaluate the argument <else>, if there is one, and returns the result else the function returns Nil. That function is the internal representation of the alternative if whose syntax is preferable for lisibility reasons.
• Exemple(s): definition of a macro f(x) representing a piecewise function f of a variable x :
Si(%1<-1,1-exp(pi*(%1+1)),%1<0,sin($\pi$*%1),sh(pi*%1)),

ie: $f\left(x\right)=1-exp\left(\pi \left(x+1\right)\right)$ if $x<-1$, $f\left(x\right)=sin\left(\pi x\right)$ if $-1\le x<0$, $f\left(x\right)=$sh$\left(\pi x\right)$ if not.