10. Records
10 Records
A record is a data structure for storing a fixed number of elements. It has named fields and is similar to a struct in C. Record expressions are translated to tuple expressions during compilation. Therefore, record expressions are not understood by the shell unless special actions are taken. For details, see the shell(3)
manual page in STDLIB.
More examples are provided in Programming Examples
.
10.1 Defining Records
A record definition consists of the name of the record, followed by the field names of the record. Record and field names must be atoms. Each field can be given an optional default value. If no default value is supplied, undefined
is used.
-record(Name, {Field1 [= Value1], ... FieldN [= ValueN]}).
A record definition can be placed anywhere among the attributes and function decla