When learning a new language its always difficult to google the meaning of operators. I ran into this problem when reading erlang source and trying to figure out what the hash sign does. Searching for "erlang hash" would always lead to articles about computing MD5 hashes in erlang. I had to resort to asking the question on stack overflow.So for the sake of the next person who googles this "What does the hash operator do in erlang?"
Record is a compound data type in erlang which gives named access to the elements it contains similar to a struct in c. To use records we must first define their structure:
To initialize we use the aforementioned hash sign as a prefix to the statement. Notice that I can choose not to supply values for the elements, elements with default values will have those assigned others will remain undefined.
To access records we use our trusty hash operator again and use the element name to retrieve data:
Updating records is much like initializing except that any elements that we do not specify values for will retain retain previous values.