caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Nicolas Pouillard" <nicolas.pouillard@gmail.com>
To: Gabriel Kerneis <kerneis@enst.fr>
Cc: caml-list <caml-list@yquem.inria.fr>
Subject: Re: [Camlp4] Antiquotation and unescaped strings
Date: Tue, 19 Feb 2008 00:01:40 +0100	[thread overview]
Message-ID: <1203375694-sup-3248@ausone.local> (raw)
In-Reply-To: <20080218143412.GA4411@kerneis.info>

[-- Attachment #1: Type: text/plain, Size: 1206 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 194 bytes --]

  reply	other threads:[~2008-02-18 23:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-18 14:34 Gabriel Kerneis
2008-02-18 23:01 ` Nicolas Pouillard [this message]
2008-02-19  6:53   ` Gabriel Kerneis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1203375694-sup-3248@ausone.local \
    --to=nicolas.pouillard@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=kerneis@enst.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).