From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id OAA16734; Tue, 24 Sep 2002 14:55:37 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id OAA17096 for ; Tue, 24 Sep 2002 14:55:35 +0200 (MET DST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g8OCtX519228; Tue, 24 Sep 2002 14:55:33 +0200 (MET DST) Received: from santenay.inria.fr (santenay.inria.fr [128.93.8.59]) by pauillac.inria.fr (8.7.6/8.7.3) with SMTP id OAA15882; Tue, 24 Sep 2002 14:55:33 +0200 (MET DST) Date: Tue, 24 Sep 2002 14:55:32 +0200 From: Maxence Guesdon To: Alessandro Baretta Cc: henri.dubois-ferriere@epfl.ch, caml-list@inria.fr Subject: Re: [Caml-list] choosing modules at runtime Message-Id: <20020924145532.2068ae1e.maxence.guesdon@inria.fr> In-Reply-To: <3D905E0E.5040202@baretta.com> References: <3D905E0E.5040202@baretta.com> Organization: INRIA X-Mailer: Sylpheed version 0.8.2claws (GTK+ 1.2.10; ) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk You can use records : type t = { f1 : int -> int f2 : string -> int ... } let module1 = let ... (* whatever you want *) in { f1 = ... ; f2 = ... ; ... } let module2 = let ... (* whatever you want *) in { f1 = ... ; f2 = ... ; ... } let algo = if cond then module1.f1 else module2.f2 -- Maxence Guesdon ------------------- 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