Examples

Conditionals

An if is a guard. The lines after it are its else.

main (print)

# An if guards a block. When it holds, the block's value is the answer
# and nothing below runs. When it fails, reading continues on the next
# line. The lines after an if are its else.
sign(n int) str
    if n < 0
        "negative"
    if n == 0
        "zero"
    "positive"

between(n int, lo int, hi int) bool
    n >= lo and n <= hi and not (n == 13)

main()
    a = sign(0 - 5)
    b = sign(0)
    c = between(7, 1, 10)
    print.line("{a} {b} {c}")
negative zero true