Collections

Collections in Ozark come in three flavors. There are arrays and tuples, which offer powerful subscript-based access to groups of pointers, and there are other pointer-based collection types that can be built with generics.

An Array is an immutable, nestable, homogeneous, 1-based ordered list of non-optional objects or values. Arrays can be specified literally using square bracket ([]) notation, or created sequentially as the output of a repeat loop or repeating "all" statement.

A Tuple is an immutable, nestable, heterogenous, 1-based ordered group that may include both values and/or objects. Tuples can be specified literally by separating the values with a comma (,). Eligible variables that store tuples may be marked as optional, but individual elements of a tuple may not (because that would make it a different tuple). A tuple with only one element is identical to the element itself.

Tuples can be nested or stored in arrays using curly bracket syntax ({ and })

Tuples are often used as method inputs and/or outputs, which gives the effect of allowing positional parameters side-by-side with named ones.

You can use the extract and split keywords on a property or output that contains an array or a tuple. This returns a 2-tuple of the extracted portion and the remaining portion, respectively. split removes multiple elements, where extract removes only one.