I have a real code but I made this sample to illustrate my issue. This is the code sample:
let ejem n =
let count = ref 0 in
let rec aum n =
if n = 0 then 0
else (count := !count + 1; n + aum (n-1) )
in (aum n, !count)
I try to change the count value inside aum function but, despite the count is outside of this function, its value is always 0 once it finishes.
Please, help me to get what the issue is