/

Iterable

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.

Collection

An ordered or unordered Markdown list is automatically converted to an ordered collection.

Example 1

.var {letters}
    - A
    - B
    - C

.foreach {.letters}
    .1::lowercase

a

b

c

Nested collections can be represented by nested Markdown lists as well.

Example 2

.var {letters}
    - - A
      - B
    - - C
      - D
    - - E
      - F

.foreach {.letters}
    .1::first

A

C

E

Pair

A pair is an iterable of two values.

You can create a pair via .pair {first} {second} or retrieve one as a Dictionary entry.

Dictionary

When used in a function that requires an iterable, a Dictionary value is treated as a list of key-value pairs.

Range

An integer Range is a valid ordered iterable value.

Operations

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.