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
..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:
#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
Methods are functions that are available on values of a type. They can be called for a value using the
Returns the captured positional arguments as an array.
value.pos() -> array
Returns the captured named arguments as a dictionary.
value.named() -> dictionary