I feel slightly ashamed for asking such a trivial question but here I go.
I need a function to increment a globally defined mutable variable.
let seed_index = ref 0;;
let incr_seed() =
seed_index := !seed_index + 1;;
However, I can't get it to work in the interpreter.
# incr_seed();;
- : unit = ()
# seed_index;;
- : int ref = {contents = 0}