Docs
Collections and ranges
Lists, anonymous products, indexing, assignment, and inclusive ranges.
Lists
$ xs = [1, 2, 3]
$ first = xs[0]
~ xs[0] = 9
~ xs[2] = xs[0] + xs[1]
Lists are ordered reference values. An alias or function parameter shares the same list, so an indexed write is visible through every alias. List literals and call arguments do not allow trailing commas.
Anonymous products
$ point = { x: 3, y: 4 }
$ x = point.x{ name: value } creates an anonymous struct: a structural product with named fields. It is not a general map and has no named type tag. Use a named struct literal when methods or type-match arms are needed.
Ranges
lo..hi creates an inclusive integer range. Bind it, iterate over it, or use it as a match arm.
/ std/io
~ total = 0
* n : 1..4 {
~ total = total + n
}
| total {
1..9 {
io.print('small')
}
10..20 {
io.print('medium')
}
: {
io.print('large')
}
}Unavailable literals
Echo has no null literal, map literal, or set literal. Option values come from function return shapes; there is no standalone none literal. Trailing commas are rejected.