caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Nicolas Pouillard" <nicolas.pouillard@gmail.com>
To: "Martin Jambon" <martin.jambon@ens-lyon.org>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Camlp4 3.10.0+beta: lists without $list:...$
Date: Sat, 24 Mar 2007 13:21:48 +0100	[thread overview]
Message-ID: <cd67f63a0703240521n48c4c7c8ie389a19eaa18f983@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0703231121180.14832@localhost>

On 3/23/07, Martin Jambon <martin.jambon@ens-lyon.org> wrote:
> On Fri, 23 Mar 2007, Nicolas Pouillard wrote:
>
> > On 3/23/07, Martin Jambon <martin.jambon@ens-lyon.org> wrote:

[...]

> >
> > BTW, have you read these slides
> > http://gallium.inria.fr/~pouillar/pub/camlp4/renovation-camlp4-longue.pdf

Oops I don't remember that was in French (sorry for those that can't read it)

> OK, I am trying to convert my syntax extensions and everyday I hit a new
> problem, which by default I report as a bug because if it's not documented
> as an intentional incompatiblity, it must be a bug.

Yes I understand your point, but that's why I pointed out these slides
that talk about many of these features, even if it's from a
presentation point of view.

> I started with pa_json_static.ml
> (from http://martin.jambon.free.fr/json-static.html)
> because it's fairly complete and doesn't use any dirty trick.
> It manipulates all kinds of types, each of them as exprs, patts and ctyps.
> So I guess once this works, it would be a big progress toward upgrading
> all my stuff.
>
> I'll publish the commented diffs as soon as I get a version that works,
> but it would be much faster if you could do it for me. The thing is I
> don't really know how I can help.

If I start traducing all camlp4 extensions (or the first of everyone),
I'm not done!

<just kidding>
Perhaps there is a need for some consulting services on camlp4 :)
</just kidding>

> For now I am stuck with record type definitions:
> With quotations in the revised syntax (command camlp4orf), how to create a
> record field with an optional mutable flag?
>
>   <:ctyp< $name$ : $opt:is_mutable$ $t1$ >>

Generally all flags: private, mutable, virtual, rec, .., to/downto now
have their own antiquotation.

<:expr< let $rec:is_rec$ f f = f in f >>
<:class_str_item< value $mutable:is_mutable$ x = 42 >>
<:ctyp< < meth1 : int ; meth2 : float $..:raw_variable$ > >>
...

However there is some exceptions to that rule.

A private type is a type surrounded by a node "private".
That's now the same thing for mutable types.

You can define this function if you want:

let mkmutable is_mutable = if is_mutable then <:ctyp< mutable $t$ >> else t

Or rewrite a little the code to take a better profit of this change.

BTW: camlp4/Camlp4Parsers/Camlp4OCamlRevisedParser.ml contains many of
your answers.

Best regards,

-- 
Nicolas Pouillard


  reply	other threads:[~2007-03-24 12:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-23  6:13 Martin Jambon
2007-03-23 16:03 ` [Caml-list] " Markus Mottl
2007-03-23 16:35 ` Nicolas Pouillard
2007-03-23 19:00   ` Martin Jambon
2007-03-24 12:21     ` Nicolas Pouillard [this message]
2007-03-24 20:24       ` Martin Jambon
2007-03-26  6:48         ` Markus Mottl
2007-03-26  7:27       ` Hendrik Tews

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=cd67f63a0703240521n48c4c7c8ie389a19eaa18f983@mail.gmail.com \
    --to=nicolas.pouillard@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=martin.jambon@ens-lyon.org \
    /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).