Nouns can be classified in two ways:
- by structure, e.g. atom, list, dictionary
- by datatype, e.g. integer, character, date, list
Note that list is both a structure (a list of things), and a datatype. Each item of a list will have its own datatype.
Q data structures are: atoms, lists, associations, dictionaries, tables and keyed tables.
The core building blocks are atoms and lists:
- an atom is a single data item, such as a single integer, date or symbol
- a list is an ordered collection of atoms or lists
Two lists can be joined in an association of keys and values. All other structures are built from lists and associations:
- an association relates keys to values
- a dictionary is an association where the keys are symbols
- a table is a flipped (transposed) dictionary, where values all have the same length
- a keyed table is an association of two tables (the key columns, and the non-key columns)