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: 2004-08-04 (17:23)
From: henri dubois-ferriere <henridf@g...>
Subject: Re: [Caml-list] Conditional Modules
this isn't possible, because modules are not first class values.

there was a thread on this with some examples of how to get around it:


On Wed, 4 Aug 2004 15:58:50 +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.
> Of course "module M = if ...  " is a syntax error.   My question is:
> how to achieve this behaviour (and generalisations of it) in ocaml?
> It seems that this is an obvious thing to want to do but I haven't
> found any clues in the manual or the FAQs.  Is it me?
> -r
> -------------------
> To unsubscribe, mail Archives:
> Bug reports: FAQ:
> Beginner's list:

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