From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q41Bax4C020311 for ; Tue, 1 May 2012 13:36:59 +0200 X-IronPort-AV: E=Sophos;i="4.75,509,1330902000"; d="scan'208";a="156254547" Received: from walapai.inria.fr ([128.93.30.24]) by mail1-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 01 May 2012 13:36:54 +0200 Received: from walapai.inria.fr (localhost [127.0.0.1]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q41Bas3x020308 for ; Tue, 1 May 2012 13:36:54 +0200 Received: (from sympa@localhost) by walapai.inria.fr (8.13.6/8.12.10/Submit) id q41BasaZ020307 for caml-list@inria.fr; Tue, 1 May 2012 13:36:54 +0200 Date: Tue, 1 May 2012 13:36:54 +0200 X-Authentication-Warning: walapai.inria.fr: sympa set sender to sympa@inria.fr using -f To: caml-list@inria.fr From: Jonathan Kimmitt In-Reply-To: 4F9EBF8C.2060309@cs.cornell.edu Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Caml-list] Generating coinductive elements Not sure if it useful for you but you can actually convert a string/function/file into an ocaml phrase and execute it from within a program, for example: [jrrk100@angcatlnxsrv10 v2abc]$ ocaml Objective Caml version 3.12.0 # Toploop.execute_phrase true Format.err_formatter ((!Toploop.parse_toplevel_phrase) (Lexing.from_string "355./.113.;;"));; - : float = 3.14159292035398252 - : bool = true # [jrrk100@angcatlnxsrv10 v2abc]$ I demonstrate it from within the toplevel interpreter but there is nothing to stop you compiling with the Toploop library into an executable. This works with bytecode, I have not tried it with ocamlnat(the native top-level)