caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Nicolas Pouillard" <nicolas.pouillard@gmail.com>
To: "Hendrik Tews" <H.Tews@cs.ru.nl>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] camlp4 3.10 questions
Date: Thu, 29 Mar 2007 18:10:53 +0200	[thread overview]
Message-ID: <cd67f63a0703290910t4077ae7emd107c6a35cdaba96@mail.gmail.com> (raw)
In-Reply-To: <wwuhcs49hh8.fsf@tandem.cs.ru.nl>

On 3/29/07, Hendrik Tews <H.Tews@cs.ru.nl> wrote:
> "Nicolas Pouillard" <nicolas.pouillard@gmail.com> writes:
>
>    On 3/29/07, Hendrik Tews <H.Tews@cs.ru.nl> wrote:
>    >
>    > 1. What is the difference between Register.Printer and
>    >    Register.OCamlPrinter? I guess it boils down to the difference
>    >    between Sig.Syntax and Sig.Camlp4Syntax?
>
>    Yes it's mainly a difference about what your printer really needs. If
>    you use the camlp4 AST then you need a Sig.Camlp4Syntax as argument,
>    if it's not needed then you can use Sig.Syntax.
>
> Does this mean I have to use Camlp4Syntax and OCamlPrinter it I
> want to use quotations? Or do the quotations also work on
> Sig.Syntax?

You need Camlp4Syntax to use camlp4 quotations (like expr, patt, ctyp...).

>
>    > 3. Register.declare_dyn_module puts all modules in a queue
>    >    together with a function that contains some delayed side
>    >    effects. Where are these function called?
>
>    Camlp4Bin.ml
>
> Well, I was that far. But where in Camlp4Bin?

It's done trough Register.iter_and_take_callbacks in the function called main.

>    > 5. I saw Camlp4OCamlOriginalQuotationExpander, presumably this is
>    >    a quotation expander for quotations in original syntax. Is
>    >    this already complete?
>
>    Complete, not really but usable yes.
>
> Are there just corner cases missing or whole branches of the
> syntax?

Just corner cases, I hope.

>    >    What is camlp4prof?
>
>    A profiling toy.
>
> Well... profiling what?

There is a filter (called Camlp4Profiler) that adds to all functions
something like:

let f x y z = body

become:

let f x y z =
let () = Camlp4prof.count "f @ foo.ml line 42 ..." in body

Then the camlp4prof module store all these calls and writes
"camlp4_profiler.out" at exit.

Running the camlp4prof program dumps that file.

PS: For now that's just a toy.

Best regards,

-- 
Nicolas Pouillard


  reply	other threads:[~2007-03-29 16:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-28 22:36 Hendrik Tews
2007-03-29  9:48 ` [Caml-list] " Nicolas Pouillard
2007-03-29 15:50   ` Hendrik Tews
2007-03-29 16:10     ` Nicolas Pouillard [this message]
2007-03-29 21:47   ` Hendrik Tews
2007-03-29 21:57     ` Nicolas Pouillard
2007-03-30 11:13       ` Hendrik Tews
2007-03-30 16:13         ` Nicolas Pouillard

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=cd67f63a0703290910t4077ae7emd107c6a35cdaba96@mail.gmail.com \
    --to=nicolas.pouillard@gmail.com \
    --cc=H.Tews@cs.ru.nl \
    --cc=caml-list@yquem.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;
as well as URLs for NNTP newsgroup(s).