Instructions presented below declare a local variable in entrypoints' effect section.
A local variable is declared by the
var keyword followed by the variable identifier and the initial value.
For example, the following declares a variable
counter with initial value
It is possible to specify the variable type:
var except that a
const local variable cannot be modified by an assignment instruction.
For example, the following instructions generates a compilation error:
?= (get option, assign or fail)
It is possible to declare a local variable (
var) as the
some value of an
option variable, and fail with an error message if this variable is
For example, the following declares a
const local variable as the some value of the execution of
unpack buitlin which returns an option value:
By default, it fails with
It is equivalent to:
For example, suppose
m is a
map of type
The above declaration fails with pair
("KEY_NOT_FOUND", k). It is equivalent to: