Skip to main content

Literals and indexing

Arrays are heterogeneous (elements don’t need matching types), 0-indexed, and mutable in place. Indexing with a non-Int or an out-of-range index is a runtime error, not a silent nil:

Typed array declarations

Array<T> checks every element against T when the annotation is present — see Values & Types for how annotation-checking works generally.

Concatenation

+ concatenates two arrays (the same operator used for string concatenation and numeric addition — see operators):

Builtins

What’s not here yet

No slicing (xs[1:3]), no built-in map/filter/reduce, no dictionaries/maps/objects — the value model is deliberately minimal in Phase 1 (see Roadmap). A for loop plus if covers the same ground for now:

Continue

Modules

Splitting a program across files.

Grammar reference

The complete EBNF, including array literal syntax.