Skip to main content

Variables

Variables are declared with let … be … and reassigned with set … to …. These are two distinct forms — let introduces a new binding in the current scope; set walks up enclosing scopes to find and mutate an existing one.

let total be 0
set total to total + 10

Redeclaring a name with let inside a nested block shadows the outer variable for that block only — it does not overwrite it.

caution

Assigning to a name that was never declared with let, in any enclosing scope, raises a runtime error: Undefined variable '<name>'.