English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
invoke function from its name as string
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-03-13 (05:04)
From: Ludovic Coquelle <lcoquelle@g...>
Subject: invoke function from its name as string
(re-send as it seems it didn't go through)

First, hello everyone as it is my first message to this list ;)

 I'm trying to solve this problem:
 I have a module name and function name in string variables,
 and I would like to call this function, like :
 let mod = "MyMod" in
 let fn = "my_fun" in
 what_come_here mod fn

 Can this problem be solved?
 Was thinking that camlp4 could help ... not sure as it change the
 syntax tree but I don't see how to get access to module name 'mod'.

 Any pointer are greatly appreciated :)
 thanks