Erlang Central

Records

Revision as of 11:08, 15 July 2007 by Farmacia (Talk | contribs)

Contents

Defining Records

-record( recordname, { element1, element2, element3 } ).

Creating a Record

R = #recordname{ element1 = "One", element2 = 2, element3 = three }.

Matching a Record

elementTwoTimesEight( #recordname{ element2 = T } ) -> T * 8.

More Information

More information at http://erlang.org/doc/getting_started/records_macros.html#5.3.