Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Collections

Acton provides several built-in collection types for storing and organizing data.

  • Lists - ordered mutable sequences, like [1, 2, 3] or ["foo", "bar"]
  • Dictionaries - ordered key-value mappings, like {"foo": 1, "bar": 3}
  • Sets - unordered collections of unique elements, like {"foo", "bar"}

All collection types require elements to be of the same type. For example, a list can contain only integers or only strings, but not both. Similarly, dictionary keys must all be of the same type, and all values must be of the same type.