From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id EEEC0BC69 for ; Mon, 13 Aug 2007 08:59:58 +0200 (CEST) Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l7D6xwxa024817 for ; Mon, 13 Aug 2007 08:59:58 +0200 X-IronPort-AV: E=Sophos;i="4.19,252,1183327200"; d="scan'208";a="1293602" Received: from anice-252-1-75-230.w83-201.abo.wanadoo.fr (HELO [192.168.1.31]) ([83.201.157.230]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 13 Aug 2007 02:38:50 +0200 Message-ID: <46BFA819.4010805@irisa.fr> Date: Mon, 13 Aug 2007 02:38:49 +0200 From: Thomas Gazagnaire User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: caml-list@yquem.inria.fr Subject: instanciation of functor using command line Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 46C0016E.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; irisa:01 functor:01 functor:01 parametrized:01 argv:01 argv:01 foo:01 foo:01 ideally:01 signatures:01 enumerate:01 modules:02 modules:02 match:02 match:02 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