Variable

Variable Declaration

@(x, y)

=> + Type

@(
    x: i32,
    y: f64,
)

=> + Optional Type

@(
    x: i32 | f64 | None
)

Resource Initialization (Immutable)

Resources can't be changed once initialized.

@(x <- 1, y <- 2)

Variable Declaration => Assignment

=> Mutable

@(x, y) = (1, 2)

=> Immutable

Once a variable is assigned a value using the walrus symbol :=, it becomes immutable.

@(x, y) := (1, 2)

Adaptive Transformation

This is equivalent to resources initialization.

@(x, y) <~ (1, 2)

Last updated