arguments
Captured arguments to a function.
Like built-in functions, custom functions can also take a variable number of
arguments. You can specify an argument sink which collects all excess
arguments as ..sink
. The resulting sink
value is of the arguments
type. It
exposes methods to access the positional and named arguments and is iterable
with a for loop. Inversely, you can spread
arguments, arrays and dictionaries into a function call with the spread operator:
func(..args)
.
Example
#let format(title, ..authors) = [
*#title* \
_Written by #(authors
.pos()
.join(", ", last: " and "));._
]
#format("ArtosFlow", "Jane", "Joe")

MethodsMethods are functions that are available on values of a type. They can be called for a value using the .
operator.
Methods are functions that are available on values of a type. They can be called for a value using the
.
operator.pos
method
Returns the captured positional arguments as an array.
value.pos() -> array
named
method
Returns the captured named arguments as a dictionary.
value.named() -> dictionary