caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Markus Mottl <markus@mail4.ai.univie.ac.at>
To: Daniel de Rauglaudre <daniel.de_rauglaudre@inria.fr>
Cc: OCAML <caml-list@inria.fr>
Subject: Re: [Caml-list] canonical camlp4-suffix?
Date: Tue, 4 Sep 2001 14:43:35 +0200	[thread overview]
Message-ID: <20010904144335.B9377@chopin.ai.univie.ac.at> (raw)
In-Reply-To: <20010904082037.B27407@verdot.inria.fr>; from daniel.de_rauglaudre@inria.fr on Tue, Sep 04, 2001 at 08:20:37 +0200

On Tue, 04 Sep 2001, Daniel de Rauglaudre wrote:
> On Mon, Sep 03, 2001 at 05:58:40PM +0200, Markus Mottl wrote: I
> generally prefer using ".ml" and ".mli" because some tools of the
> compiler does not accept different suffixes (e.g. the debugger). For
> the rules, there are two methods:

Thanks, this is important to know! I don't want to have nasty side
effects when using a non-standard suffix so I'll stay with ".ml" and
".mli" and scan the file for suitable preprocessing options.

> 1/ add in source files comments specifying how compile the file; in the
>    Makefiles, call a shell script reading this comment and launching
>    the good command; it is the method I use in the sources of Camlp4
>    (see the files tools/Makefile.tpl and tools/camlp4_comm.sh in Camlp4
>    sources) and in GeneWeb (same kind of shell script): this shell
>    just calls ocamlc without -pp parameter if the comment is not found.

Ok, I had something like this in mind. Good to know where to find an
example implementation.

> 2/ compile all files with "-pp camlp4o" (or "-pp camlp4r" if you prefer
>    the revised syntax) and use "#load" in your files: this has been possible
>    (however not yet documented) since some versions of Camlp4. For example,

Nice! Though, if I already have to check for a preprocessing tag anyway,
I could also do things as follows:

The topmost line in a file could read like this:

  (*pp camlp4o -I some_dir some_quots.cmo some_more_quots.cmo *)

Then I just check for the 'pp' tag, and if it's there, I just take the
contents of the comment as parameter for the -pp option. This could then
also be a completely different preprocessor (cpp? ;).

Please tell me, if there is any hidden catch with this approach.
Thanks for the hints!

Regards,
Markus Mottl

-- 
Markus Mottl                                             markus@oefai.at
Austrian Research Institute
for Artificial Intelligence                  http://www.oefai.at/~markus
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


  reply	other threads:[~2001-09-04 12:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-03 15:58 Markus Mottl
2001-09-03 16:31 ` Clement Renard
     [not found] ` <Pine.BSF.3.96.1010903120605.42306B-100000@fledge.watson.org>
2001-09-03 16:36   ` Markus Mottl
     [not found] ` <FLELJKKJEIKNBDJGMIHKGEFKCAAA.franka@cs.uu.nl>
2001-09-03 20:26   ` Markus Mottl
2001-09-04  6:20 ` Daniel de Rauglaudre
2001-09-04 12:43   ` Markus Mottl [this message]
2001-09-04 14:00     ` Daniel de Rauglaudre

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=20010904144335.B9377@chopin.ai.univie.ac.at \
    --to=markus@mail4.ai.univie.ac.at \
    --cc=caml-list@inria.fr \
    --cc=daniel.de_rauglaudre@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).