From: sejourne_kevin <sejourne_kevin@yahoo.fr>
To: "Sébastien Hinderer" <Sebastien.Hinderer@ens-lyon.org>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Syntactic inclusion of a.ml in b.ml ?
Date: Sat, 09 Apr 2005 12:54:06 +0000 [thread overview]
Message-ID: <4257D06E.4070505@yahoo.fr> (raw)
In-Reply-To: <20050408174142.GA1804@galois>
Sébastien Hinderer a écrit :
> Dear all,
>
> (How) is it possible to include syntactically a file a.ml in a file
> b.ml ?
>
> One method that seems to w)rk is to rename b.ml to b.ml.c,
> and then have in b.ml.c a line saying
> #include "a.ml"
> And with this, gcc -E b.ml.c > b.ml
> produces a file that ocamlc can apparently handle.
>
> But is this considered a good solution, or is some better solution
> available ?
>
> Many thanks in advance,
> Sébastien.
If you want to use a pre-processor, you can do things like that:
(* ocamlc -pp /lib/cpp test.ml *)
#define P(x) (fst x) (snd x) (fst x)
#define S(x) (snd x)
let x = ("world","hello");;
Printf.printf "%s %s %s %s\n" S(x) P(x);;
or use camlp4
for the use of include :
http://caml.inria.fr/pub/docs/manual-ocaml/manual019.html#@manual.kwd167
next prev parent reply other threads:[~2005-04-09 10:44 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-08 17:41 Sébastien Hinderer
2005-04-09 10:35 ` [Caml-list] " Richard Jones
2005-04-09 13:20 ` Sébastien Hinderer
2005-04-09 14:45 ` [Caml-list] " Radu Grigore
2005-04-09 15:49 ` Sébastien Hinderer
2005-04-09 21:15 ` [Caml-list] " Radu Grigore
2005-04-09 17:51 ` [Caml-list] " Robert Roessler
2005-04-09 21:27 ` William D.Neumann
2005-04-10 16:53 ` Richard Jones
2005-04-09 11:55 ` Olivier Andrieu
2005-04-09 12:54 ` sejourne_kevin [this message]
2005-04-09 21:16 ` Martin Jambon
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=4257D06E.4070505@yahoo.fr \
--to=sejourne_kevin@yahoo.fr \
--cc=Sebastien.Hinderer@ens-lyon.org \
--cc=caml-list@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