(...ArgsT) -> ReturnT.
First-class functions
Pass a function as a callback:myPlus has the type (int, int) -> int. A function demo, for example, is () -> void.
Assigning functions to variables also works:
Lambda functions
Tolk supports lambda functions:a and b are int, inferred from invokeMath declaration.
If they cannot be inferred, the parameter types must be specified:
Low-level TVM continuations
Continuations are executable cells representing TVM bytecode. A callable is effectively a typed continuation. Tolk has a typecontinuation type for low-level purposes.
For example, TVM register c3 contains current smart contract code.
Some functions are available in stdlib:
Stack layout and serialization
A callable is backed by TVMCONT. It cannot be serialized.
For details, follow TVM representation and Serialization.