September 2013
Intermediate to advanced
548 pages
12h 25m
English
In a small tuple, remembering what the individual elements represent is rarely a problem, but when there are a large number of elements in the tuple, it becomes convenient to name the individual elements. Once we have named the elements, we will be able to refer to them using the name and not have to remember what position they had in the tuple.
To name the elements in a tuple, we use a record declaration that has the following syntax:
| | -record(Name, { |
| | %% the next two keys have default values |
| | key1 = Default1, |
| | key2 = Default2, |
| | ... |
| | %% The next line is equivalent to |
| | %% key3 = undefined |
| | key3, |
| | ... |
| | }). |
Warning: record is not a shell command (use rr in the shell; see the description that ...
Read now
Unlock full access