From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q3P84RRE030899 for ; Wed, 25 Apr 2012 10:04:27 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsICAImvl0/CYk3SmWdsb2JhbABEgx2rB4MtIgEBAQEBCAsLBxQnggkBAQUnEUARCxgJFg8JAwIBAgFFEwgBAYgPux+NUoMlBJtujTU X-IronPort-AV: E=Sophos;i="4.75,480,1330902000"; d="scan'208";a="141515646" Received: from mel.act-europe.fr ([194.98.77.210]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/ADH-CAMELLIA256-SHA; 25 Apr 2012 10:04:22 +0200 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 765692900A1 for ; Wed, 25 Apr 2012 10:04:28 +0200 (CEST) X-Virus-Scanned: amavisd-new at eu.adacore.com Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZkSsCoLt+qnF for ; Wed, 25 Apr 2012 10:04:28 +0200 (CEST) Received: from [10.10.127.248] (dhcp-guest-248.act-europe.fr [10.10.127.248]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 63E94290091 for ; Wed, 25 Apr 2012 10:04:28 +0200 (CEST) Message-ID: <4F97B005.3090005@lri.fr> Date: Wed, 25 Apr 2012 10:04:21 +0200 From: Claire Dross User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.28) Gecko/20120313 Thunderbird/3.1.20 MIME-Version: 1.0 To: caml-list@inria.fr References: <4F8C4054.6010407@lri.fr> In-Reply-To: <4F8C4054.6010407@lri.fr> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] Problem with the compiler 3.12.1 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