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: Ross Duncan <ross.duncan@c...>
Subject: Re: [Caml-list] Conditional Modules
Thanks to everyone who replied to my plea for help.  Unfortunately I 
don't believe that any of the very good suggestions I received will 
solve my problem.  As John Prevost said:

> (And that's the real reason
> that you can't do conditionals to choose one of several modules: you
> can't do conditionals at runtime on types!)

If I had specified my problem a little more carefully I might have said

module type T =
		type t
		(* some other stuff involving t *)

module M1 : T = ....
module M2 : T = ....

(* and now choose at runtime between M1 and M2 *)

It seems that all the *other stuff* can be chosen at runtime with 
various degrees of elegance but the type t is the big spanner which 
stops the machine.

So I guess my request for help should now become a feature request for 
the language!  Is this at all compatible with static typing?

Thanks again for all the suggestions.

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