From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by sympa.inria.fr (Postfix) with ESMTPS id 88D287ED38 for ; Tue, 10 Jul 2012 17:08:40 +0200 (CEST) Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of jeannin@cs.cornell.edu) identity=pra; client-ip=128.84.103.139; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="jeannin@cs.cornell.edu"; x-sender="jeannin@cs.cornell.edu"; x-conformance=sidf_compatible Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of jeannin@cs.cornell.edu) identity=mailfrom; client-ip=128.84.103.139; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="jeannin@cs.cornell.edu"; x-sender="jeannin@cs.cornell.edu"; x-conformance=sidf_compatible Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@exch-hub2.cs.cornell.edu) identity=helo; client-ip=128.84.103.139; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="jeannin@cs.cornell.edu"; x-sender="postmaster@exch-hub2.cs.cornell.edu"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuYEADRF/E+AVGeLbmdsb2JhbABFtB6De0MigiIFOjQdATwCQicEG4gFmzSYXYkEkQJgA5U2kwA X-IronPort-AV: E=Sophos;i="4.77,559,1336341600"; d="scan'208";a="150214009" Received: from mail-hub-2.cs.cornell.edu (HELO exch-hub2.cs.cornell.edu) ([128.84.103.139]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-MD5; 10 Jul 2012 17:08:39 +0200 Received: from gobo.cs.cornell.edu ([128.84.96.141]) by exch-hub2.cs.cornell.edu ([128.84.103.139]) with mapi; Tue, 10 Jul 2012 11:08:37 -0400 From: Jean-Baptiste Jeannin To: "caml-list@inria.fr" Date: Tue, 10 Jul 2012 11:08:36 -0400 Thread-Topic: Returning an element computed with Toploop Thread-Index: AQHNXq3hNrqobqndS06wAwj+3y/Glg== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: [Caml-list] Returning an element computed with Toploop Hello all, Thanks to Jonathan Kimmitt on this mailing list, I learned about the existe= nce of the Toploop module, that allows to execute OCaml code from a string.= For example, one can do: # Toploop.execute_phrase true Format.err_formatter ((!Toploop.parse_toplevel_phrase) (Lexing.from_string "355./.113.;;"));; - : float =3D 3.14159292035398252 - : bool =3D true However I could not find any official documentation of the module on the in= ternet. In particular, the example above only prints out what was computed = and returns a boolean (true or false), depending on how the computation ter= minated. I would like to compute an element and get the element back to be = able to use it later in the computation. Is that possible and how could I d= o it? Thanks a lot, Jean-Baptiste=