From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 158357FCCB for ; Sat, 2 May 2015 20:46:33 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of omeragacan@gmail.com) identity=pra; client-ip=209.85.212.182; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="omeragacan@gmail.com"; x-sender="omeragacan@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of omeragacan@gmail.com designates 209.85.212.182 as permitted sender) identity=mailfrom; client-ip=209.85.212.182; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="omeragacan@gmail.com"; x-sender="omeragacan@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-wi0-f182.google.com) identity=helo; client-ip=209.85.212.182; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="omeragacan@gmail.com"; x-sender="postmaster@mail-wi0-f182.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0DSAgC7GkVVlLbUVdFcg19cBYMYwj8JgU6GDAKBSwc4FAEBAQEBAQERAQEBAQcLCwkfMIQhAQEEEhEdARseAwwGBQsPAiYCAiEBAREBBQEcBhMih3QBAxGmUz4xizmBa4J2iBcKGScNVoRIAQEIAQEBARgBBQ6BE4oYgk2CBTqCaIFFBZYehGyBVYFhjV2FFhIjgQwJggiCKyIxgkUBAQE X-IPAS-Result: A0DSAgC7GkVVlLbUVdFcg19cBYMYwj8JgU6GDAKBSwc4FAEBAQEBAQERAQEBAQcLCwkfMIQhAQEEEhEdARseAwwGBQsPAiYCAiEBAREBBQEcBhMih3QBAxGmUz4xizmBa4J2iBcKGScNVoRIAQEIAQEBARgBBQ6BE4oYgk2CBTqCaIFFBZYehGyBVYFhjV2FFhIjgQwJggiCKyIxgkUBAQE X-IronPort-AV: E=Sophos;i="5.13,356,1427752800"; d="scan'208";a="138643174" Received: from mail-wi0-f182.google.com ([209.85.212.182]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 02 May 2015 20:46:32 +0200 Received: by widdi4 with SMTP id di4so82401156wid.0 for ; Sat, 02 May 2015 11:46:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=sQzOFpHAgMEpwZNXyBbosScDzsjCkiLycxd7096V9Lo=; b=TtxlKk/j5M4Jxpk8I8xocK1H6rY2rsEr8p3wbpPXR1tat/jMpMisqnLdUYTYxsPwla pVd1dZ3wWpoJFjMS3iiWcK+UNjGWjL5Z1JJyx5VbbAATMqiUedjzbW7LIOtBVeZIWwmB JkwgpUooyL6JFyD5TrYyj//wsvsBCj/Gfz/ErY1XE/wNh6jEYI1rnM2BE5/pTelR+7FH VUe6uSAnwG3jmHsI6RvaVkoXVtV8HnC1t4xHJ6Z8fWuEgtM30pv6RtyjofcD25c8FGFG ycwryKLvveEpyqcLXnum+BMVDLLJVojLMptoQ+DpF2nxjZvnF6YEwWBIgnqQJALVQHMI Ywrg== X-Received: by 10.180.102.164 with SMTP id fp4mr6732356wib.67.1430592392571; Sat, 02 May 2015 11:46:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.187.212 with HTTP; Sat, 2 May 2015 11:45:52 -0700 (PDT) In-Reply-To: References: <20150501112114.1C8DFC382A@www1.g3.pair.com> <1430496980.1158661.261513285.08E1920C@webmail.messagingengine.com> <1430498707.1164081.261525093.47AD6B00@webmail.messagingengine.com> From: =?UTF-8?Q?=C3=96mer_Sinan_A=C4=9Facan?= Date: Sat, 2 May 2015 14:45:52 -0400 Message-ID: To: OCaml Mailing List Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Caml-list] Problems with printing MetaOCaml generated code In case anyone's still interested, I produced a very simple example that demonstrates the issue: =E2=9E=9C metaocaml_serialization_issue git:(master) =E2=9C=97 ls Main.ml Syntax.ml =E2=9E=9C metaocaml_serialization_issue git:(master) =E2=9C=97 cat Synta= x.ml type stx =3D | A | B of stx | C of (stx * stx) =E2=9E=9C metaocaml_serialization_issue git:(master) =E2=9C=97 cat Main.= ml open Format open Print_code open Runcode open Syntax let _ =3D let stx1 =3D A in let stx2 =3D B A in let stx3 =3D C (A, A) in print_code std_formatter .< stx1 >.; print_code std_formatter .< stx2 >.; print_code std_formatter .< stx3 >.; print_closed_code std_formatter (close_code .< stx1 >.); print_closed_code std_formatter (close_code .< stx2 >.); print_closed_code std_formatter (close_code .< stx3 >.); =E2=9E=9C metaocaml_serialization_issue git:(master) =E2=9C=97 metaocaml= c Syntax.ml -c =E2=9E=9C metaocaml_serialization_issue git:(master) =E2=9C=97 metaocamlc Syntax.cmo Main.ml -o main =E2=9E=9C metaocaml_serialization_issue git:(master) =E2=9C=97 ./main .<(* CSP stx1 *) Obj.magic 0>. .<(* CSP stx2 *)>. .<(* CSP stx3 *)>. .< (* CSP stx1 *) Obj.magic 0>. .<(* CSP stx2 *)>. .<(* CSP stx3 *)>. =E2=9E=9C metaocaml_serialization_issue git:(master) =E2=9C=97 2015-05-01 12:53 GMT-04:00 =C3=96mer Sinan A=C4=9Facan : >> You can't serialize `eval_ref` as `eval_ref` because that is a local >> identifier. If you print out `eval_ref` into some other ml file and comp= iler >> it, it is going to give an "Unbound identifier eval_ref" error. > > That's true. Just to make sure and make the output more clear, I moved the > relevant code to another module, and now it's printing this: > > .. > > My main question is that it should serialize p' here, but it doesn't. I'm > trying to understand why.