$args
$args(
@indices ? ## required
) -> llll/null
note
$args
is a built-in function in the bell programming language and is not unique or exclusive to bellplay~.
Returns one or more arguments passed to the function that calls it, based on their indices. The number of arguments is available through the $argcount
pseudovariable. Arguments after the ellipsis can't be returned by $args
.
Arguments
@indices
[llll] (required)
Output
Positional arguments at positions @indices
. [llll/null]
warning
$args
will return null
without raising an error if required arguments are not provided.
Usage
$myfunc = (
<...> -> (
for $i in 1...$argcount do print('argument at position' $i '->' $args($i)
)
);
$myfunc('foo', 'bar', 'baz')