Iterable values are ordered lists or unordered sets that you can iterate through with a loop.
Iterables can also be destructured. See Destructuring for more information.
An ordered or unordered Markdown list is automatically converted to an ordered collection.
.var {letters}
- A
- B
- C
.foreach {.letters}
.1::lowercasea
b
c
Nested collections can be represented by nested Markdown lists as well.
.var {letters}
- - A
- B
- - C
- D
- - E
- F
.foreach {.letters}
.1::firstA
C
E
A pair is an iterable of two values.
You can create a pair via .pair {first} {second} or retrieve one as a Dictionary entry.
When used in a function that requires an iterable, a Dictionary value is treated as a list of key-value pairs.
An integer Range is a valid ordered iterable value.
Assuming myiterable is an iterable, you can access useful operations such as getat, sorted, average, and many more via function call chaining as .myiterable::operation.
For a complete list of operations, refer to the standard library’s Collection documentation.