Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Conditional Modules
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] Conditional Modules
On Wed, Aug 04, 2004 at 03:58:50PM +0100, Ross Duncan wrote:
> Forgive me for asking what might be an easy question, I am just a 
> beginner with Ocaml.  I want to do something like this:
> module M = if arg then M1 else M2
> module A = F (M)
> (* define rest of program using fields of A *)
> The idea being that arg will come from e.g. the command line, and 
> modules M1, M2 and functor F are defined elsewhere.

I suspect that the only way to do it would be with pa_macro.cmo (part
of Camlp4).  This means it would be done at compile time, which is
probably not what you wanted.

(BTW: What is the difference between pa_macro and pa_ifdef?  I have
both on my system, and they appear to do much the same thing.)


Richard Jones.
Merjis Ltd. - improving website return on investment - CRM improvement consultancy

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: