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

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

You cannot declare a variable without initialization.

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 initialization, so the value of the variable is calculated only at the first call to it.

Variables built into the script

The script has built-in variables.

results matching ""

    No results matching ""