From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id DDD3C7EE25 for ; Sat, 2 Nov 2013 22:27:20 +0100 (CET) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of yallop@gmail.com) identity=pra; client-ip=209.85.212.175; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yallop@gmail.com"; x-sender="yallop@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of yallop@gmail.com designates 209.85.212.175 as permitted sender) identity=mailfrom; client-ip=209.85.212.175; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yallop@gmail.com"; x-sender="yallop@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-wi0-f175.google.com) identity=helo; client-ip=209.85.212.175; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yallop@gmail.com"; x-sender="postmaster@mail-wi0-f175.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ak4DANNsdVLRVdSvlGdsb2JhbAA+GoM/RwyDCLx1gRUIFg4BAQEBBwsLCRIqgiUBAQQBIwQZARsdAQMBCwYFCw0CAiYCAiEBAREBBQEcBhOHbgEDCQYNNp5RjARTgwmDbAoZJw1kiQEBBQyBHYs/gnAHgmuBQwOWH4FrgS+LIwODSBgphFE8 X-IPAS-Result: Ak4DANNsdVLRVdSvlGdsb2JhbAA+GoM/RwyDCLx1gRUIFg4BAQEBBwsLCRIqgiUBAQQBIwQZARsdAQMBCwYFCw0CAiYCAiEBAREBBQEcBhOHbgEDCQYNNp5RjARTgwmDbAoZJw1kiQEBBQyBHYs/gnAHgmuBQwOWH4FrgS+LIwODSBgphFE8 X-IronPort-AV: E=Sophos;i="4.93,623,1378850400"; d="scan'208";a="33281523" Received: from mail-wi0-f175.google.com ([209.85.212.175]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 02 Nov 2013 22:27:20 +0100 Received: by mail-wi0-f175.google.com with SMTP id hm4so2375941wib.14 for ; Sat, 02 Nov 2013 14:27:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=IHwTTx5Mz1i8JG4sASLiOIxFAr6h3A1V4w8PsIzmdbw=; b=bKrHD3Z4AYaq61sdQCg8CH3rOwh8QLukfGOlhIlI3rd7hPFn8V2JOiG1Qa4Lrdzngs fdiiZeL6xDB1xA9EUscLWVWAW3iNaB/zuE9xXrC/cgZnffiEMvMA9HXxclhwDL0yLnkf gdsXLfmYGrTL6fJ82YU1uoHbtUONL2/Vz86fc/gZqNNDg3Nkt35SeEOXqPa2Di9GXDp/ cDLkTVwr9EIElhlxm29T7vhIKoSsvKqGKncn5w5OJFZ9i4nnsV2JuAKpb+fkNWKBeqmM Y0hGuwvmFsfp64taRvYfKYFcJ/o5/LrKGin7lRvFiZMDe3x1W5gtlggv2p2WXjHdpeMJ OkCg== MIME-Version: 1.0 X-Received: by 10.180.37.227 with SMTP id b3mr6617691wik.24.1383427639798; Sat, 02 Nov 2013 14:27:19 -0700 (PDT) Received: by 10.216.185.65 with HTTP; Sat, 2 Nov 2013 14:27:19 -0700 (PDT) In-Reply-To: <52755917.2000808@gmail.com> References: <52755917.2000808@gmail.com> Date: Sat, 2 Nov 2013 21:27:19 +0000 Message-ID: From: Jeremy Yallop To: Matej Kosik <5764c029b688c1c0d24a2e97cd764f@gmail.com> Cc: Caml Content-Type: text/plain; charset=UTF-8 Subject: Re: [Caml-list] camlp4: a silly question about quoting Ocaml terms On 2 November 2013 19:57, Matej Kosik <5764c029b688c1c0d24a2e97cd764f@gmail.com> wrote: > 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> Yes. > 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. I think it's a bug in camlp4, which appears to be parsing "foo1:bar1" as part of a function type with a labelled argument (such as "foo1:bar1 -> int"). It'd be worth submitting a report on Mantis (http://caml.inria.fr/mantis) about the problem. In the meantime you can work around the issue either by writing the AST by hand or by switching to the revised syntax, which doesn't have this ambiguity. Jeremy.