# val x = ref 1;
val x = ref 1 : int ref
# fun inc () = (x := !x + 1; !x);
val inc = fn : unit -> int
# inc();
val it = 2 : int
# inc();
val it = 3 : int
ref, :=, and ! in this example are
builtin primitives for reference types described in
Section 19.20.