Home > DeveloperSection > Interviews > What is a record and how you can define records in Erlang?

Posted on    June-27-2015 12:53 AM

 erlang Functional Programming  Concurrent Programming  erlang 
 1 Answer(s)
  380  View(s)
Rate this:

Mayank Tripathi
Mayank Tripathi

Total Post:807

Posted on    June-27-2015 12:53 AM

For storing a fixed number of elements, a data structure is used which is referred as record. Expressions are translated into tuple expressions during compilation record.

Record in Erlang is defined by the name of the record, followed by the field names of the record. Record and field names must be atoms.

• record (Name, { Field1 [= Value] , … FieldN [= ValueN] } )

Don't want to miss updates? Please click the below button!

Follow MindStick