Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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 (04:07)
From: Ludovic Coquelle <lcoquelle@g...>
Subject: invoke function from its name as string
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 :)