caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Conditional Modules
@ 2004-08-04 14:58 Ross Duncan
  2004-08-04 16:02 ` Richard Jones
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Ross Duncan @ 2004-08-04 14:58 UTC (permalink / raw)
  To: caml-list

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 caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2004-08-06  7:53 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-04 14:58 [Caml-list] Conditional Modules Ross Duncan
2004-08-04 16:02 ` Richard Jones
2004-08-04 16:29   ` Michel Mauny
2004-08-04 16:45   ` John Prevost
2004-08-04 17:22     ` Shivkumar Chandrasekaran
2004-08-05 11:23     ` Ross Duncan
2004-08-05 12:34       ` Alain Frisch
2004-08-05 15:10       ` Jean-Baptiste Rouquier
2004-08-05 15:54         ` Christophe Raffalli
2004-08-06  7:53           ` Alain Frisch
2004-08-04 17:23 ` henri dubois-ferriere
2004-08-04 17:24 ` james woodyatt
2004-08-04 18:01   ` John Prevost

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).