From: Stefano Zacchiroli <zack@bononia.it>
To: caml-list@inria.fr
Cc: Pietro Abate <Pietro.Abate@anu.edu.au>
Subject: Re: [Caml-list] load modules by name
Date: Tue, 21 Jan 2003 11:48:50 +0100 [thread overview]
Message-ID: <20030121104850.GA15163@lordsoth.takhisis.org> (raw)
In-Reply-To: <20030121072228.GA6481@anu.edu.au>
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
next prev parent reply other threads:[~2003-01-21 18:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-21 7:22 Pietro Abate
2003-01-21 10:48 ` Stefano Zacchiroli [this message]
2003-01-22 16:41 ` [Caml-list] " Michaël Grünewald
2003-01-28 13:42 [Caml-list] " rich
2003-01-28 15:56 ` Yann Régis-Gianas
2003-01-28 17:47 ` Nicolas Cannasse
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=20030121104850.GA15163@lordsoth.takhisis.org \
--to=zack@bononia.it \
--cc=Pietro.Abate@anu.edu.au \
--cc=caml-list@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