Lists

Lists contain an ordered collection of elements. Depending on usage, they may represent arrays, maps or sets.

Each element of a list may be a value of any type. Optionally, the element may have an associated key, which is also a value of any type. Keys need not be unique. An element may be retrieved or set by using either its position in the list or its key.

Yewslip> list = [5, nil, "item", "last" = 0]

Yewslip> print list
[5, (nil), item, last = 0]

Yewslip> print list[0], list[2]
5 item

Yewslip> print list("last")
0