Collections

Arrays, tuples, maps, and ranges. Each has its own literal syntax and a full set of methods.

Arrays

Arrays are ordered, mutable, and can hold values of any type.

scratch.xs
scratch.xs
scratch.xs

Tuples

Tuples are immutable fixed-size sequences. Access elements with numeric field syntax.

scratch.xs

Maps

Map literals use #{ to distinguish them from blocks. Keys can be strings or integers. Maps preserve insertion order.

scratch.xs
scratch.xs

Ranges

Ranges are lazy sequences of integers. 0..10 excludes 10; 0..=10 includes it.

scratch.xs

Comprehensions

Array and map comprehensions provide a concise alternative to explicit loops.

scratch.xs