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 TAA24201; Tue, 21 Jan 2003 19:56:10 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA23869 for caml-list@pauillac.inria.fr; Tue, 21 Jan 2003 19:56:09 +0100 (MET) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA08758 for ; Tue, 21 Jan 2003 11:49:19 +0100 (MET) Received: from cartoonia.phd.cs.unibo.it (phd.cs.unibo.it [130.136.6.1]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h0LAnIv22693 for ; Tue, 21 Jan 2003 11:49:18 +0100 (MET) Received: from lordsoth.takhisis.org (postfix@lordsoth.phd.cs.unibo.it [130.136.6.119]) by cartoonia.phd.cs.unibo.it (8.9.3/8.8.7) with ESMTP id LAA15497; Tue, 21 Jan 2003 11:49:00 +0100 Received: by lordsoth.takhisis.org (Postfix, from userid 3148) id AC539706E; Tue, 21 Jan 2003 11:48:50 +0100 (CET) Date: Tue, 21 Jan 2003 11:48:50 +0100 From: Stefano Zacchiroli To: caml-list@inria.fr Cc: Pietro Abate Subject: Re: [Caml-list] load modules by name Message-ID: <20030121104850.GA15163@lordsoth.takhisis.org> Mail-Followup-To: caml-list@inria.fr, Pietro Abate References: <20030121072228.GA6481@anu.edu.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030121072228.GA6481@anu.edu.au> User-Agent: Mutt/1.5.3i Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tue, Jan 21, 2003 at 06:22:28PM +1100, Pietro Abate wrote: > is it possible ? Yes, just use the Dynlink module. You can find a great usage example in the O'Reilly book [1] (debian package available in debian/unstable ocaml-book-{en,fr}). Anyway, returning to your example you should have an association list ref, say "algos", and you should use it as let algo = try List.assoc "command_line_option" !algos with Not_found -> failwith "Module not loaded" Then you should have a set of .cmos that you should load using 'Dynlink.loadfile', each module should update the 'algos' association list adding itself to it. Hope this helps, Cheers. [1] http://caml.inria.fr/oreilly-book/html/ -- Stefano Zacchiroli - Undergraduate Student of CS @ Uni. Bologna, Italy zack@{cs.unibo.it,debian.org,bononia.it} - http://www.bononia.it/zack/ " I know you believe you understood what you think I said, but I am not sure you realize that what you heard is not what I meant! " -- G.Romney ------------------- 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