Erlang Central

Records

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

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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.