From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 9750FBBC1 for ; Thu, 13 Mar 2008 07:47:51 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ah0CAKJq2EfBAkMth2dsb2JhbACQcwEBAQgKKZRN X-IronPort-AV: E=Sophos;i="4.25,492,1199660400"; d="scan'208";a="8332221" Received: from vega.fmf.uni-lj.si (HELO postar.fmf.uni-lj.si) ([193.2.67.45]) by mail2-smtp-roc.national.inria.fr with ESMTP; 13 Mar 2008 07:47:51 +0100 Received: from localhost (unknown [192.168.5.1]) by postar.fmf.uni-lj.si (Postfix) with ESMTP id 5323D3C7E66; Thu, 13 Mar 2008 07:47:49 +0100 (CET) X-Virus-Scanned: amavisd-new at spam.fmf.uni-lj.si Received: from postar.fmf.uni-lj.si ([192.168.5.5]) by localhost (spam.fmf.uni-lj.si [192.168.5.1]) (amavisd-new, port 10024) with ESMTP id 6D6k+GmXqLyZ; Thu, 13 Mar 2008 07:47:49 +0100 (CET) Received: from [192.168.1.115] (BSN-77-148-136.static.dsl.siol.net [193.77.148.136]) (Authenticated sender: bauer) by postar.fmf.uni-lj.si (Postfix) with ESMTP id 71DBA3C83CD; Thu, 13 Mar 2008 07:47:48 +0100 (CET) Message-ID: <47D8CE92.2020009@fmf.uni-lj.si> Date: Thu, 13 Mar 2008 07:49:54 +0100 From: Andrej Bauer Reply-To: Andrej.Bauer@andrej.com User-Agent: Thunderbird 1.5.0.14ubu (X11/20080306) MIME-Version: 1.0 To: caml-list@yquem.inria.fr Cc: lcoquelle@gmail.com Subject: Re: [Caml-list] invoke function from its name as string References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; andrej:01 andrej:01 ocaml:01 ocaml:01 invoke:01 wrote:01 caml-list:01 variables:02 string:02 string:02 python:03 seems:03 module:03 let:03 let:03 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