Declarations

The in-built let function lets you define constants in the current scope. It takes one array as an argument.

This defines name in the current scope:

let [name = "Lu"]

You might prefer to leave off the brackets:

let name = "Lu"

Overloading

You can define the same constant more than once.

let colour = "red"
let colour = 255, 70, 70

The most recently defined constant of the expected type gets used.

Scoped

let name = "Luke" in {
    print "Hello {name}!"
}

Last updated

Was this helpful?