From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <5764c029b688c1c0d24a2e97cd764f@gmail.com> 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 82C5B7EE25 for ; Sat, 2 Nov 2013 20:57:13 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of 5764c029b688c1c0d24a2e97cd764f@gmail.com) identity=pra; client-ip=74.125.82.44; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="5764c029b688c1c0d24a2e97cd764f@gmail.com"; x-sender="5764c029b688c1c0d24a2e97cd764f@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of 5764c029b688c1c0d24a2e97cd764f@gmail.com designates 74.125.82.44 as permitted sender) identity=mailfrom; client-ip=74.125.82.44; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="5764c029b688c1c0d24a2e97cd764f@gmail.com"; x-sender="5764c029b688c1c0d24a2e97cd764f@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-wg0-f44.google.com) identity=helo; client-ip=74.125.82.44; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="5764c029b688c1c0d24a2e97cd764f@gmail.com"; x-sender="postmaster@mail-wg0-f44.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Am0MAC1YdVJKfVIslGdsb2JhbAA+GoIfgSDBbhYOAQEBAQcLCwkSKoJTGQEbHAIDEhAWFhgDAgECARERAQUBIg0IAodqAQMPBAEINptSgwSMV4MJg3AKGScNZIkBAQUMlAEDmAqBL4UOiWBBhFE X-IPAS-Result: Am0MAC1YdVJKfVIslGdsb2JhbAA+GoIfgSDBbhYOAQEBAQcLCwkSKoJTGQEbHAIDEhAWFhgDAgECARERAQUBIg0IAodqAQMPBAEINptSgwSMV4MJg3AKGScNZIkBAQUMlAEDmAqBL4UOiWBBhFE X-IronPort-AV: E=Sophos;i="4.93,623,1378850400"; d="scan'208";a="40421270" Received: from mail-wg0-f44.google.com ([74.125.82.44]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 02 Nov 2013 20:56:48 +0100 Received: by mail-wg0-f44.google.com with SMTP id n12so735670wgh.23 for ; Sat, 02 Nov 2013 12:57:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=oIJBQCki4SV7VaJOMnpzPwuTaNd93yyhB8yv1LfItmw=; b=E/nLPyvKTgJkraDCdgSx1CjUmNbtobWPZ2GhSoVm1zbLMVJadGQ+BO6Y9ZE4Cwr/ae 3vH/Qmp5pA/LUwnJlbjS83uuD+LW4EXjzzTF0PvgbGgXnOHubSH/E0Ogk2AtiCrs8Q/I 0OWI/So2GdZUqgdX8UhJtJGT5x0AhfTPZ16v60aGjQmYA8935arxca1qwdsK8KgABDZN kcQVAb7iKV+RQF7yhRJE7vYXI2RpLucndgoFplyoFDQ2n9ppifUROpoVSSRkP4CD9i7b pteWRyNSTDIQsQ++qCu+3yPgLAcb2g62HpH7bgJ4XlJaIwezNWs7B5c9RK9vnEgWnqHh J0Cg== X-Received: by 10.180.37.67 with SMTP id w3mr6701543wij.56.1383422232770; Sat, 02 Nov 2013 12:57:12 -0700 (PDT) Received: from [172.27.6.170] ([213.106.240.92]) by mx.google.com with ESMTPSA id qc10sm20115546wic.9.2013.11.02.12.57.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 02 Nov 2013 12:57:12 -0700 (PDT) Message-ID: <52755917.2000808@gmail.com> Date: Sat, 02 Nov 2013 19:57:11 +0000 From: Matej Kosik <5764c029b688c1c0d24a2e97cd764f@gmail.com> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131005 Icedove/17.0.9 MIME-Version: 1.0 To: Caml X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [Caml-list] camlp4: a silly question about quoting Ocaml terms Hello, According to various sources, Ocaml provides convenient means for generating Ocaml AST. Yesterday I decided to look into the matter. Now I am trying to generate a record type. To certain point, things make sense. This: <:ctyp<{foo1:bar1; foo2:bar2}>> is expanded to Ast.TyRec (_loc, (Ast.TySem (_loc, (Ast.TyCol (_loc, (Ast.TyId (_loc, (Ast.IdLid (_loc, "foo1")))), (Ast.TyId (_loc, (Ast.IdLid (_loc, "bar1")))))), (Ast.TyCol (_loc, (Ast.TyId (_loc, (Ast.IdLid (_loc, "foo2")))), (Ast.TyId (_loc, (Ast.IdLid (_loc, "bar2"))))))))) By looking at: http://brion.inria.fr/gallium/index.php/Abstract_Syntax_Tree#Types there is a line: <:ctyp< t : t >> ....... Field declaration ........ TyCol of Loc.t and ctyp and ctyp so it seems that it should also be somehow posible to get a quote for "field declaration", i.e.: <:ctyp> However, if I try that, I get an error: While expanding quotation "ctyp" in a position of "expr": Parse error: "->" expected after [ctyp level star] (in [ctyp] I do not quite understand why that quotation was rejected by camlp4. Of course, it is perfectly possible to write: Ast.TyCol (_loc, (Ast.TyId (_loc, (Ast.IdLid (_loc, field_name)))), field_type but I am wondering whether there is a more intelligent way to do that (e.g. <:ctyp> or something like that). --- As always, thank you in advance for your kind help.