The basic collection types are arrays, strings, and tables.
An identical double-ended queue (deque) API is supported by both arrays and strings. A string can be thought of as an array which only contains characters.
Collections
lenReturns the number of items in a collection.
empty?Returns #t if a collection contains no items.
accessRetrieves an item from a collection.
access=Mutates an item in a collection.
has?Returns #t if a collection contains a particular item.
remove!Removes an item from a collection, and returns it.
del!Deletes an item from a collection, without returning it.
clear!Deletes all items from a collection.
map-syntaxMaps a function over a collection, preserving syntax information.
Arrays
arrConstructs a new, mutable array.
arr-from-elemConstructs a new, mutable array by repeating a value.
Deques
push!Appends one or more elements to the end of a deque.
push-start!Prepends one or more elements to the beginning of a deque.
pop!Removes the deque's last element, and returns it.
pop-start!Removes the deque's first element, and returns it.
insert!Inserts one or more elements into a deque.
grow!Increases a deque's size.
shrink!Reduces a deque's size.
swap-remove!Swaps an element with the deque's last element, then removes it and returns it.
swap-remove-start!Swaps an element with the deque's first element, then removes it and returns it.
sortReturns a sorted copy of a deque.
sort!Sorts a deque in-place.
starts-with?Tests whether one deque is the prefix of another.
ends-with?Tests whether one deque is the suffix of another.
positionSearches within a deque.
rpositionSearches backwards within a deque.
rev!Reverses a deque in-place.
map!Maps a function over a deque in-place.
retain!Filters a deque in-place.
joinCombines an array of deques into one deque.