Below is the description of the instructions used in AIR scripts.
This instruction is intended to launch the execution of a function. It works as follows:
- The function is executed on the peer specified by the
- The peer is expected to have the WASM service specified by the
- The service must have a callable function specified be the
- The arguments specified by the
argument listparameter are passed to the function.
- The result of the function is saved and available under the name
The above example of the
callinstruction can be thought of as
data.result = dht.put(key, value)
seq instruction takes two instructions as its arguments and executes them sequentially, one after the other.
par instruction takes two instructions two instructions as its arguments and executes them in parallel.
This instruction is intended for iterating over the elements of an array. It works as follows:
foldinstruction takes three arguments: an array, a variable, and an instruction.
- At each iteration, the variable is assigned an element of the array and the argument-instruction is executed.
- The argument-instruction can access the variable and uses the
nextstatement to trigger the next iteration.
This instruction is intended for organizing branches in the flow of execution as well as for handling errors. It works as follows:
xorinstruction takes two instructions as its arguments.
- The first instruction is executed.
- If the execution is successful, then the second instruction is ignored.
- If the first instruction fails, then the second one is executed.
This is an empty instruction: it takes no arguments and does nothing. The
null instruction is useful for generating code.
Updated a day ago