# omit

The `omit` keyword denotes the missing value. The `omit` can only be assigned to optional fields of `record` and `set` types to indicate that an optional field is not present.

Related keywords:

- optional
- record
- set

### omit

Example:

`module m {
type record R { integer field1 optional, boolean field2 }
type set S { integer field1 optional, boolean field2 }
control {
var R r1 := { omit, false };
var S s1 := { field1 := omit, field2 := true };
var S s2;
s2.field1 := omit;
s2.field2 := false;
}
}`

Both type S and R contain an optional field1 element. Variable r1 is initialized using the value list notation; the optional field is omitted. Variable s1 is initialized using the value assignment notation; the optional field1 is not present. Finally, variable s2 is not initialized. Its fields are set via normal assignments through field references (i.e. using the dot notation); field1 is absent, again.

BNF definition of omit