list
list <value>…
Collect any number of values into an iterable over those arguments, in order.
Use it to build an iterable on the spot — a fixed set of choices, a
gathered group of entities, or a literal sequence to drive
each. The arguments may be of mixed types.
Arguments
<value>…— zero or more values of any type. They become the iterable's elements in the order written. With no arguments the result is an empty iterable.
Returns
An iterable over the arguments. Consume it with each,
count, first, choose,
select, or another iterable consumer.
Examples
after command (say) {
each [list "north" "east" "south"] { <dir>
do "say I could go $dir."
}
}
[list ...] builds a three-element iterable that drives
each; the mob names each direction in turn. The block
parameter <dir> is declared inside the braces, right after {.
after command (say) {
do "say [count [list 1 hello $self]] mixed values."
}
The arguments can mix types — here an int, a string, and a
creature. [count ...] evaluates to 3, so the mob says "3 mixed
values."
after command (say) {
do "say A random color: [choose [list red green blue]]."
}
choose picks one element at random from the list.