Records
A record is an abstract data type containing a series of named fields. It has no associated behaviour and acts as a way to group data together. In C++, this would be referred to as a plain old data type.
Depending on the language, records may be expressed in in different ways.
| Language | Equivalent Construct |
|---|---|
| Rust | Struct |
| C | Struct |
| Python | Data Class |
| TypeScript | Type alias |
Syntax
A record contains a list of fields, where each field must be given a type.
record person {
name: string,
age: u32,
has-lego-action-figure: bool,
}
For a more details, consult the Item: record section in the
*.wai format.