caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Hendrik Tews <tews@cs.ru.nl>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Camlp4: example/parse_files.ml
Date: Fri, 04 Apr 2008 23:30:58 +0200	[thread overview]
Message-ID: <wwuwsnd8fzh.fsf@tandem.cs.ru.nl> (raw)
In-Reply-To: <1207318438-sup-662@ausone.inria.fr> (Nicolas Pouillard's message of "Fri, 04 Apr 2008 16:19:16 +0200")

"Nicolas Pouillard" <nicolas.pouillard@gmail.com> writes:

   I think that's doable (not tested), basically you need three
   primitive functors:

I don't see how. Let me clarify again what I mean. And let me
clarify that I only pursue this discussion out of curiosity, to
see, what can be done with the functorial Camlp4 interface. 

Assume we have a table like this:

    s1.cmo s2.cmo ... : f1.ml f2.ml ...
    s3.cmo s4.cmo ... : f3.ml f4.ml ...

The sx.cmo files are Camlp4 syntax extentions and the fx.ml are
files to be parsed using those syntax extentions. There are a
number of possible solutions:
- starting camlp4 for each file or each row
- clearing PreCast.Syntax before each row and then calling the
  callbacks that the syntax extensions registered

But I would like to know if the functorial Camlp4 design is
strong enough to solve this exercise within one program (without
fork/exec) and without reusing/clearing one syntax module.

It is clear that the registration in Register.SyntaxExtension is
not good enough, because it always applies the syntax extension
to PreCast.Syntax.

However, even with changing Register.SyntaxExtension or how
syntax extensions register themselves, I can't see a solution.

Bye,

Hendrik



  reply	other threads:[~2008-04-04 21:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-02 23:13 Hendrik Tews
2008-04-03 15:32 ` [Caml-list] " Nicolas Pouillard
2008-04-03 21:24   ` Hendrik Tews
2008-04-04 13:40     ` Nicolas Pouillard
2008-04-04 14:01       ` Hendrik Tews
2008-04-04 14:19         ` Nicolas Pouillard
2008-04-04 21:30           ` Hendrik Tews [this message]
2008-04-05 10:00             ` Nicolas Pouillard
2008-04-07  7:31               ` Hendrik Tews
2008-04-07  8:10                 ` 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=wwuwsnd8fzh.fsf@tandem.cs.ru.nl \
    --to=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).