---
title: "The Record Format Constructor"
canonical: "https://docs.magma-maths.org/v2.30-1/SetsSequencesMappings/Records/creation-format.html"
source: "https://docs.magma-maths.org/v2.30-1/SetsSequencesMappings/Records/creation-format.md"
part: "Sets, Sequences, and Mappings"
chapter: "Records"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Sets, Sequences, and Mappings", "source": "https://docs.magma-maths.org/v2.30-1/SetsSequencesMappings/index-sets-sequences-mappings.md"}
  - {"title": "Records", "source": "https://docs.magma-maths.org/v2.30-1/SetsSequencesMappings/Records/index-records.md"}
prev: {"title": "Introduction", "source": "https://docs.magma-maths.org/v2.30-1/SetsSequencesMappings/Records/introduction.md"}
next: {"title": "Creating a Record", "source": "https://docs.magma-maths.org/v2.30-1/SetsSequencesMappings/Records/creation-record.md"}
intrinsics:
  - {"name": "recformat", "signature": "recformat< L >: FieldnameList -> RecFormat"}
examples:
  - "ex-d1148b"
---

# The Record Format Constructor

The special constructor `recformat< ... >` is used for the creation of record formats. A record format must be created before records in that format are created.

<a id="constructor-constructor-recformat-fieldnamelist-recformat"></a>
## `recformat< L >: FieldnameList -> RecFormat`

Construct the record format corresponding to the non-empty fieldname list $L$. Each term of $L$ must be one of the following:

**(a)**
$fieldname$ in which case there is no restriction on values that may be stored in this field of records having this format;

**(b)**
$fieldname {:}expression$ where the expression evaluates to a magma which will be the parent of values stored in this field of records having this format; or

**(c)**
$fieldname {:}expression$ where the expression evaluates to a category which will be the category of values stored in this field of records having this format;

where $fieldname$ consists of characters that would form a valid identifier name. Note that it is not a string.

<a id="example-ex-d1148b"></a>
## `Example: Creating a Record Format (ex-d1148b)`

We create a record format with these fields: `n`, an integer; `misc`, which has no restrictions; and `seq`, a sequence (with any universe possible).

```magma
> RF := recformat< n : Integers(), misc, seq : SeqEnum >;
> RF;
recformat<n: IntegerRing(), misc, seq: SeqEnum>
> Names(RF);
[ n, misc, seq ]
```
