Below is an extract of code : (the problem is visible by testing only this extract)
let cptIdCO = ref 0;; (* compteur : id Classe et Object globale *)
let makeEtiClassOrObj =
cptIdCO := !cptIdCO + 1;
"ClObj_" ^ (string_of_int !cptIdCO) ^ ": NOP
";;
let compileClass cls =
print_string "-- compileClass
";
(*fillClass cls;*)
print_string makeEtiClassOrObj;
and compileObject obj =
print_string "-- compileObject
";
print_string makeEtiClassOrObj;
When calling compileClass
or compileObject
several times, the output is always ClObj_1: NOP
so it seems that the reference is not updated and I don't understand why.
I saw some uses of ^:=
and !^
but it don't work and I don't understand the difference between the normal and ^
versions.