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:
optionvalue is set to
- the entry is removed from the
It fails if the option is already
none or if the map entry does not exist.
For example on an
For example on a
Note that it is the only way to get a ticket from a storage or local container (option, map). For example:
In current version, the detached value is limited to value of form:
id is a simple identifier, and
expr is an expression.