- GuardSeq1 ->
- GuardSeqN ->
The branches of an if-expression are scanned sequentially until a guard sequence GuardSeq that evaluates to true is found. Then the corresponding Body (sequence of expressions separated by ',') is evaluated.
The return value of Body is the return value of the if expression.
If no guard sequence is evaluated as true, an if_clause run-time error occurs. If necessary, the guard expression true can be used in the last branch, as that guard sequence is always true.
- is_greater_than(X, Y) ->
- X>Y ->
- true -> % works as an 'else' branch