Types
A type determines what shape a value has and what you can do with it.
You write the program body as a class (the shape of a program).
Otherwise, when you define your own type, you use one of struct, record, enum, or union.
class only allows declaration; instantiation and read/write are rejected
(struct and record).
Pages per type
Section titled “Pages per type”| Page | Forms that compile | Forms that don’t compile | Contents |
|---|---|---|---|
| Primitive types | 5 | 1 | |
| Arrays | 48 | 19 | An array holds a fixed number of values of the same type, decided in advance. |
| Enums | 7 | 2 | |
| struct and record | 34 | 7 | |
| Tuples | 10 | 2 | |
| union (sum type) | 8 | 3 | |
| Generics | 29 | 11 | |
| Interfaces | 23 | 9 |