Function Declaration

func multiplyAdd(Float x, y, Int z) -> Float {
    return x * y  +  Float(z)
}

Function declarations start with the keyword func, as in Swift.
Easier parsing due to clear distinction between function declaration vs. variable declaration, avoiding the most vexing parse.

Using the trailing return type syntax -> ReturnType, but void functions (AKA “procedures”) are written without trailing -> Void:

func print(String line) { ... }

Function parameters are given as TypeName parameterName, multiple function parameters of the (exact) same type can be combined:
func multiply(Int x, y) -> Int // x and y are Int

Misc

Function Pointers

Trying to maintain consistency between declarations of functions, function pointers, functors and lambdas.

Examples:

Function Parameters

By default, function arguments are passed as const reference. Only small types (with a size of up to 16 bytes) are passed as const value.

For details, see Function Parameters.