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
can be used to write if expressions in a single line.