From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id B88BABBC1 for ; Tue, 19 Feb 2008 00:02:48 +0100 (CET) X-IronPort-AV: E=Sophos;i="4.25,373,1199660400"; d="asc'?scan'208";a="22764935" Received: from peray.inria.fr (HELO ausone.inria.fr) ([128.93.8.98]) by mail4-relais-sop.national.inria.fr with SMTP; 19 Feb 2008 00:02:46 +0100 Received: by ausone.inria.fr (sSMTP sendmail emulation); Tue, _d Feb 2008 00:01:40 +0100 From: "Nicolas Pouillard" Cc: caml-list Subject: Re: [Camlp4] Antiquotation and unescaped strings To: Gabriel Kerneis References: <20080218143412.GA4411@kerneis.info> In-Reply-To: <20080218143412.GA4411@kerneis.info> Date: Tue, 19 Feb 2008 00:01:40 +0100 Message-Id: <1203375694-sup-3248@ausone.local> User-Agent: Sup/git Content-Type: multipart/signed; protocol="application/pgp-signature"; boundary="=-1203375700-159596-19819-31-3-="; micalg="pgp-sha1" MIME-Version: 1.0 X-Spam: no; 0.00; camlp:01 camlp:01 parser:01 parser:01 ocaml:01 expr:01 expr:01 ocaml:01 wiki:01 bug:01 crystal:98 strings:01 strings:01 expression:02 string:02 X-Attachments: cset="UTF-8" type="application/pgp-signature" name="signature.asc" name="signature.asc" --=-1203375700-159596-19819-31-3-= Content-Type: text/plain; charset=UTF-8 Excerpts from Gabriel Kerneis's message of Mon Feb 18 15:34:12 +0100 2008: > Hi, Hi, > I've got a problem with antiquotations and strings in camlp4. I've got a > parser (xmlp4, used in Ocsigen) written with camlp4 which has to deal > with strings. > This parser provides a quotation mechanism to let the user input XML in > a natural way within an Ocaml program. > > Basically, the problem is the following expression (in the parser's > code): > > | PCData(s) -> [ <:expr< XHTML.EncodedPCData $str:s$ >> ] the in the antiquotation $str:s$ of <:expr<...>> the 's' string is supposed to be properly escaped, that's not any OCaml string, that's any litteral OCaml string (some chars between double quote). You should use $str:String.escaped s$ or the shortcut for it $`str:s$. [...] > Anyway, if this is an intended behavior, the explanation should be put > in BIG BOLD RED letters on the camlp4 wiki, on the quotation page. This > would help a lot (plus I would like to understand what is exactly going > on there). I think that's not a camlp4 bug, however that's right that an explanation is needed to make it crystal clear. Regards, -- Nicolas Pouillard aka Ertai --=-1203375700-159596-19819-31-3-= Content-Disposition: attachment; filename="signature.asc" Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) iEYEARECAAYFAke6DlQACgkQj+FCNw9dwLlFTQCeM45BzWU7660fzSSRyBjJ72j+ c2YAoJsHpE+swgTKURVyo2lUIGSGxBQ8 =+KL0 -----END PGP SIGNATURE----- --=-1203375700-159596-19819-31-3-=--