let n = ref 0 let f x y = x let g z = n := !n + z ; !n let () = Printf.printf "%i\n" (f (g 2) (g 7))