OCaml Mutable record fields Declaring a record with mutable fields


Example

In the following, weight is declared as a mutable field.

type person = {
  name: string;
  mutable weight: int
};;

Remark: As far as design is concerned here, one would consider the fact that a person's name isn't likely to change, but their weight is.