function
Defines a custom function that can be called later in the document. The amount of parameters (thus of expected arguments) is determined by the amount of explicit lambda parameters. Arguments can be accessed as a function call via their names. The return type of the function is dynamic, hence it can be used as an input of various types for other function calls.
Example:
.function {greet}
from to:
**Hello .to** from .from
Content copied to clipboard
The function defined in the previous example can be called normally, even with named arguments:
.greet {John} {world}
Content copied to clipboard
.greet from:{John} to:{world}
Content copied to clipboard
A parameter might also be optional. In this case, if the corresponding argument is not provided, it will be none
:
.function {greet}
from to?:
**Hello .to** from .from
Content copied to clipboard
Parameters
name
name of the function
body
content of the function. Function parameters must be explicit lambda parameters