caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* instanciation of functor using command line
@ 2007-08-13  0:38 Thomas Gazagnaire
  2007-08-13  7:17 ` Sébastien Hinderer
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Gazagnaire @ 2007-08-13  0:38 UTC (permalink / raw)
  To: caml-list

Hello,

I have a functor F parametrized by n modules types T1,T2,...,Tn :

module Make : functor (M1: S1) -> ... functor (Mn : Tn) -> [...]

and I have multiples modules Mij having the signature Ti.

Then, I would like to parse the command line in order to let the user 
choose the different modules used to implement the given signatures.

Is there any other solution that the (ugly) one of making a big "match 
argv.(1),...,argv.(n) with" to enumerate all possible n-uplet and build 
the corresponding functor ?

Ideally, I would like to do something like :

module M1 = match argv.(1) with
	| "toto" -> Toto
	| "foo" -> Foo

...

module Mn = match argv.(n) with
	| "bar" -> Bar
	| "toto" -> Toto

module F = Make(M1)(M2)...(Mn)

but it seems not possible to do that.

Thanks !

Thomas


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

end of thread, other threads:[~2007-08-20 16:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-13  0:38 instanciation of functor using command line Thomas Gazagnaire
2007-08-13  7:17 ` Sébastien Hinderer
2007-08-13  7:53   ` [Caml-list] " Jon Harrop
2007-08-20 13:49     ` Virgile Prevosto
     [not found]       ` <46C99CC3.7000508@irisa.fr>
2007-08-20 16:41         ` Virgile Prevosto

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