WHAT IS A RECORD AND HOW YOU CAN DEFINE RECORDS IN ERLANG?

Mayank Tripathi

Total Post:807

Points:4035
Posted by  Mayank Tripathi
 688  View(s)
Ratings:
Rate this:
  1. Mayank Tripathi

    Post:807

    Points:4035
    What is a record and how you can define records in Erlang?

    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] } )

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!