I have this code:
type seed = {c: Graphics.color option; x : int; y : int };;
type voronoi = {dim : int * int; seeds : seed array};;
let v1 = {dim = 50,50; seeds = [| {c=Some Graphics.red; x=50; y=100}; |]}
when i'm trying this:
v1.seeds.(0).c <- Some Graphics.green;;
i get this error:
The record field c is not mutable
what can i do ?
Record fields are immutable, unless declared otherwise. The OCaml Reference Manual (sect 1.5) says that
The following should work: