From mboxrd@z Thu Jan 1 00:00:00 1970 X-Sympa-To: caml-list@inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q3I950Xm022526 for ; Wed, 18 Apr 2012 11:05:00 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlUCABqDjk/RVdK2kWdsb2JhbABEhWaZdIhZAYkACCIBAQEBCQkNBxIpggkBAQEDARICDwQZAS0LAQMBCwEFAwIEBxodAgIiEgEFAQoSBhMIChCHXwMGBQubEAqLUoNDhUsnAwqJTQEFC49FgRgElW+BEY1IPYFYgQKBMg X-IronPort-AV: E=Sophos;i="4.75,441,1330902000"; d="scan'208";a="154533656" Received: from mail-iy0-f182.google.com ([209.85.210.182]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 18 Apr 2012 11:04:54 +0200 Received: by iahk25 with SMTP id k25so16721412iah.27 for ; Wed, 18 Apr 2012 02:04:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=+5MhC3utfviNEGg+MI5DRMIJQpOb6Bfl0fXR5dM38qY=; b=EPaMSgP8qkseCpklPmkK7PepNNKbf+4cBDNEImqCyA309My1kecq1eGgjx0wbPhNDB SqUuMn1vV0wx6ARmHYBxVIdrbVBuDupRMNr6etT35PKcM3eU5ZWqXx/z/hToA1NZx+OW zsxW+9QNdna8Q1xBC0cypVOttkKDq6U2rsMkdqSW3edrUoyzmB0+w5oApQesH1GVU/fd N6hXYbiP7XISO0y3BtOfnjVT6hqRxLu+N1EjF+hkbPCUpvAA8Uarg3uIjucYd5Qjpimx eXHVpYH4tPgAJPOaENd4nPHVPT7g0WouWH6WJPNdJHvxfPM4e6JK8VKFoCF3ux11/J+j W3wQ== Received: by 10.42.63.80 with SMTP id b16mr921620ici.29.1334739893578; Wed, 18 Apr 2012 02:04:53 -0700 (PDT) MIME-Version: 1.0 Sender: arnaud.spiwack@gmail.com Received: by 10.64.143.40 with HTTP; Wed, 18 Apr 2012 02:04:13 -0700 (PDT) In-Reply-To: <4F8C4054.6010407@lri.fr> References: <4F8C4054.6010407@lri.fr> From: Arnaud Spiwack Date: Wed, 18 Apr 2012 11:04:13 +0200 X-Google-Sender-Auth: Z-q4tgdAhnasRNT18EKjqfHGBww Message-ID: To: Claire Dross Cc: caml-list@inria.fr Content-Type: multipart/alternative; boundary=90e6ba5bb94f3969df04bdf05995 X-Validation-by: arnaud.spiwack@lix.polytechnique.fr Subject: Re: [Caml-list] Problem with the compiler 3.12.1 --90e6ba5bb94f3969df04bdf05995 Content-Type: text/plain; charset=UTF-8 Hi Claire, Without much confidence, I would start by checking matchpats for uses of fmt. On 16 April 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) on one of my tests. T.print does not > have side effects, it recursively prints a hashconsed term structure. > > Do you have any idea of what the problem is ? > > Thanks a lot, > > 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 > > --90e6ba5bb94f3969df04bdf05995 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Claire,

Without much confidence, I would start by checking matchp= ats for uses of fmt.

On 16 April 2012 17:= 52, Claire Dross <claire.dross@lri.fr> 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) =3D
=C2=A0 =C2=A0match pats, subst with
=C2=A0 =C2=A0 =C2=A0| _, [] | [], _ -> seen, forms
=C2=A0 =C2=A0 =C2=A0| t :: pats, _ -> fprintf fmt " =C2=A0 %a@.&qu= ot; T.print t;
=C2=A0 =C2=A0 =C2=A0 =C2=A0let acc =3D matchpats env terms uf (subst, seen= , id+1) t in
=C2=A0 =C2=A0 =C2=A0 =C2=A0let acc, seen, _ =3D List.fold_left (matchpats = env env.fils uf)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0acc pats in
=C2=A0 =C2=A0 =C2=A0 =C2=A0seen, List.rev_append acc forms

Removing the print in the second case of the match changes the result of th= e compiled file (compiler 3.12.1) on one of my tests. T.print does not have= side effects, it recursively prints a hashconsed term structure.

Do you have any idea of what the problem is ?

Thanks a lot,

Claire Dross

--
Caml-list mailing list. =C2=A0Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners<= /a>
Bug reports:
http://caml.inria.fr/bin/caml-bugs


--90e6ba5bb94f3969df04bdf05995--