All variables in RIDE are immutable. After definition, the value of the variable does not change.

Definition and simultaneous initialisation of the variable are performed with the help of the let operator.

You cannot declare a variable without initialisation.

During the variable assignment at the right side of the "=" sign must be an expression. The value of the variable is the expression result.


Definition of the integer variable.

let size = 5

Definition of the string variable.

let season = "Spring"

Since a function is a definition and not an expression, you can assign a function value to a variable but not the function itself.

func f() = {
let result = f()


RIDE has the lazy variable initialisation, so the value of the variable is calculated only at the first call to it.

results matching ""

    No results matching ""