args
Iterator over an argument pack.
args values are returned by variadic captures such as ...rest and by
calling the args type object. Iterating an args value yields [key, value]
pairs. Positional items use their positional index as the key.
Constructor
args ...
Creates an argument-pack iterator from positional and keyed arguments.
Returns: args
Fields
len
Number of remaining items in the argument pack.
Methods
push ...args
Appends arguments to the end of the pack.
pos
Consumes the remaining pack and returns an iterator over positional values.
Raises UnexpectedKeyError if any remaining item
is keyed.
let rest = args 1 2 3
let pos = rest.pos()
assert_eq [...pos] [1, 2, 3]
assert_eq (rest.next default: :done:) :done:
pos_keys
Consumes the remaining pack and returns a tuple of positional values and keyed arguments.
The first item is an iterator over positional values. The second item is an
args value containing only keyed items.