Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
From: Andrej Bauer <Andrej.Bauer@f...>
Subject: Re: [Caml-list] invoke function from its name as string
Ludovic Coquelle wrote:
> (re-send as it seems it didn't go through)

It did.

> 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?

If you are new to ocaml then we can help you much better if you explain
what problem you are trying to solve. It looks like you are trying to
write in Ocaml something that is common in Python/perl/shell. There is
likely to be a different, better way of doing the same thing in Ocaml.

Best regards,

Andrej