function

.function name:{String} body:{Lambda} -> Void

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

The function defined in the previous example can be called normally, even with named arguments:

.greet {John} {world}
.greet from:{John} to:{world}

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

Parameters

name

name of the function

body

content of the function. Function parameters must be explicit lambda parameters