Examples

Functions

Typed parameters, a result type, and the last expression as the value.

main (print)

# Parameters carry their types; the result type follows the parentheses.
# The last expression of the body is the value. There is no return.
square(x int) int
    x * x

sumOfSquares(x int, y int) int
    square(x) + square(y)

# A function with no result is a procedure; its type is none.
report(label str, value int) none
    print.line("{label}: {value}")

main()
    report("sum", sumOfSquares(3, 4))
sum: 25