On 16/04/2012 17:52, Claire Dross wrote:
Hello,
I am new to caml-list, so sorry in advance if it is not the right
place to make this post. In a quite important piece of ocaml code, I
have a function:
let matching_term terms env uf id (pats, subst) (seen, forms) =
match pats, subst with
| _, [] | [], _ -> seen, forms
| t :: pats, _ -> fprintf fmt " %a@." T.print t;
let acc = matchpats env terms uf (subst, seen, id+1) t in
let acc, seen, _ = List.fold_left (matchpats env env.fils uf)
acc pats in
seen, List.rev_append acc forms
Removing the print in the second case of the match changes the result
of the compiled file (compiler 3.12.1 byte code and for linux)) on one
of my tests. T.print does not have side effects, it recursively prints
a hashconsed term structure.
Using the compiler 3.11.2 instead of the 3.12.1 removes the problem. My
function returns the correct result with and without the print.
Thanks again to everyone that took time to help me,
Claire Dross
--
Caml-list mailing list. Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs