Version française
Home     About     Download     Resources     Contact us    
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 =
	sig
		type t
		(* some other stuff involving t *)
	end

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

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