Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Richard Jones <rich@annexia.org>
To: Conglun Yao <yaoconglun@gmail.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Camlp4 generate more than one (compiled) files?
Date: Fri, 17 Oct 2008 12:52:57 +0100	[thread overview]
Message-ID: <20081017115257.GA21623@annexia.org> (raw)
In-Reply-To: <f7b50d2a0810170415u3a1f618fv26ec490b7da24b91@mail.gmail.com>

On Fri, Oct 17, 2008 at 12:15:08PM +0100, Conglun Yao wrote:
> I'm just wondering is it possible to use camlp4 to generate more than
> one compiled files.
> Normally, camlp4 preprocesses a file and then pass it directly to
> compiler (for *.cmo),  or its pretty-printer (for *.ml or other
> 'plain' file).
> 
> In my case, I want to extend the syntax, and write a file, then
> preprocess (camlp4) it to generate two different *.cmo files, each one
> could be executed separately.
> 
> Is it possible?

Camlp4 extensions can open and write files normally.  However it
doesn't have access to crucial details of the 'OCaml environment' such
as the current search path for libraries, which means that it usually
cannot do anything sensible.

For example, I wanted to load another module/library from a camlp4
extension - but that sort of thing isn't possible as far as I can
tell.

I wrote a bit more about this issue here:

http://camltastic.blogspot.com/2008/05/persistent-matches-in-pabitmatch.html

Rich.

-- 
Richard Jones
Red Hat


  reply	other threads:[~2008-10-17 11:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-17 11:15 Conglun Yao
2008-10-17 11:52 ` Richard Jones [this message]
2008-10-17 13:00   ` [Caml-list] " Conglun Yao

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=20081017115257.GA21623@annexia.org \
    --to=rich@annexia.org \
    --cc=caml-list@inria.fr \
    --cc=yaoconglun@gmail.com \
    /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