Conditional Expression
The if
expression provides a simple control flow mechanism to
chose between two branches. Its use is straightforward:
A conditional expression can form the else
clause of a previous
conditional expression:
Singeline If Expressions
Keyword then
is often required in single-line if-expressions: