Collections and Text
This part covers the language’s container family and text handling: lists, sets, maps, and more.
Listlist<T> is a growable sequence and the workhorse container. Its length grows and shrinks with additions and removals, and elements can be read and written by index.
Setset<T> is a container that never holds duplicate elements: each distinct value is stored exactly once.
Mapmap<K, V> maps keys to values. Keys are unique, and a write over an existing key overwrites it. Read by index or with Get; the key set and the value set can each be taken out whole.
ArrayT[] is a fixed-length array: the length is fixed, elements are readable and writable, and assignment and argument passing share the same storage. array<T> is its named alias; the two spellings are the same type.
Iteratorfor-in is built on the Iterator<T> protocol: any type implementing it can be iterated. Lists, sets, maps, arrays, ranges, and strings all plug into this one protocol.
TextString methods cover search, trimming, reshaping, splitting and joining, and comparison; for repeated concatenation there is StringBuilder. Unless noted, methods are read-only and return new strings.
Unicode and Grapheme ClustersMushScript's character unit is not the code point; it is the extended grapheme cluster. A string's Length, indexing, slicing, and method surface all count clusters.
Last updated on October 11, 2026
