To control the flow of your programs, Clio provides if/elif/else statements.
fn check n:if n > 0: #positiveelif n < 0: #negativeelse: #zero[1 0 -1] -> * print @ #is (transform n: check)
Body of a if/elif/else statement can be either a single expression or a block of expressions. In Clio, conditional statements are functions and can be used inside a flow, for example we can re-write the above example like this:
fn check n:n -> if > 0: #positiveelif < 0: #negativeelse: #zero[1 0 -1] -> * print @ #is (transform n: check)
Clio also supports event-based control flow, but we will discuss this later.