Skip to content

Variables

Bill Hails edited this page Aug 13, 2024 · 3 revisions

Variables are immutable. They can be created by assigning a value, but assigning a value to a variable in the same scope merely creates a shadowing variable and the previous variable is hidden:

let
    x = 12; // ok
    x = "hello"; // ok
in
    print(x); // "hello"

but

y = 12; // ok
{
    y = 14; // ok
}
y; // 12

The language does not permit variable assignment.

Next: Lists

Clone this wiki locally