From: Thomas Gazagnaire <thomas.gazagnaire@irisa.fr>
To: caml-list@yquem.inria.fr
Subject: instanciation of functor using command line
Date: Mon, 13 Aug 2007 02:38:49 +0200 [thread overview]
Message-ID: <46BFA819.4010805@irisa.fr> (raw)
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
next reply other threads:[~2007-08-13 6:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-13 0:38 Thomas Gazagnaire [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46BFA819.4010805@irisa.fr \
--to=thomas.gazagnaire@irisa.fr \
--cc=caml-list@yquem.inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox