From: Jeremy Yallop <yallop@gmail.com>
To: Matej Kosik <5764c029b688c1c0d24a2e97cd764f@gmail.com>
Cc: Caml <caml-list@inria.fr>
Subject: Re: [Caml-list] camlp4: a silly question about quoting Ocaml terms
Date: Sat, 2 Nov 2013 21:27:19 +0000 [thread overview]
Message-ID: <CAAxsn=F5rGrpk6oNNprh0KhKTYgFjdpmB7W3y+5tzsDDoG2x5w@mail.gmail.com> (raw)
In-Reply-To: <52755917.2000808@gmail.com>
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<foo1:bar1>>
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.
prev parent reply other threads:[~2013-11-02 21:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-02 19:57 Matej Kosik
2013-11-02 21:27 ` Jeremy Yallop [this message]
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='CAAxsn=F5rGrpk6oNNprh0KhKTYgFjdpmB7W3y+5tzsDDoG2x5w@mail.gmail.com' \
--to=yallop@gmail.com \
--cc=5764c029b688c1c0d24a2e97cd764f@gmail.com \
--cc=caml-list@inria.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