From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <5764c029b688c1c0d24a2e97cd764f@gmail.com> X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 949D57F84F for ; Sun, 23 Feb 2014 21:24:37 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of 5764c029b688c1c0d24a2e97cd764f@gmail.com) identity=pra; client-ip=209.85.212.174; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="5764c029b688c1c0d24a2e97cd764f@gmail.com"; x-sender="5764c029b688c1c0d24a2e97cd764f@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of 5764c029b688c1c0d24a2e97cd764f@gmail.com designates 209.85.212.174 as permitted sender) identity=mailfrom; client-ip=209.85.212.174; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="5764c029b688c1c0d24a2e97cd764f@gmail.com"; x-sender="5764c029b688c1c0d24a2e97cd764f@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-wi0-f174.google.com) identity=helo; client-ip=209.85.212.174; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="5764c029b688c1c0d24a2e97cd764f@gmail.com"; x-sender="postmaster@mail-wi0-f174.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgsGADNYClPRVdSulGdsb2JhbABZghqBJ74jgxWBBhYOAQEBAQcLCwkSKoIlAQEFJxkBGxwCAwwGBQsNCRYPCQMCAQIBEREBBQEcEwgCh2wBAxEEAQiZQoxegw6VHQoZJw1khk4RAQEEDI5fFoQiAQOYNIZIiXJBhFk X-IPAS-Result: AgsGADNYClPRVdSulGdsb2JhbABZghqBJ74jgxWBBhYOAQEBAQcLCwkSKoIlAQEFJxkBGxwCAwwGBQsNCRYPCQMCAQIBEREBBQEcEwgCh2wBAxEEAQiZQoxegw6VHQoZJw1khk4RAQEEDI5fFoQiAQOYNIZIiXJBhFk X-IronPort-AV: E=Sophos;i="4.97,530,1389740400"; d="scan'208";a="59861203" Received: from mail-wi0-f174.google.com ([209.85.212.174]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 23 Feb 2014 21:24:37 +0100 Received: by mail-wi0-f174.google.com with SMTP id f8so2391453wiw.1 for ; Sun, 23 Feb 2014 12:24:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=+GMclcV9lqtBWzXXo1Nq/9ifYRPjgzBTsmcU9Iz1LKw=; b=X3JWBFaf8WKOS9BQoJ8DllLxBSDPgIJBnG21BL0c90E9GtgVY1/JDblURChxiGy62p gkTLrUwk2UAWo1/tjgnl4DAQNtKwGggu+lo+0hWOEGP5/E9mefdszTVWd0j8+yGeyV1Y 42O1fZdTAyVqpHkjPuRbNseATau1mz+yj2AmjdnsNdJTX3gzobCfcT28BoarhtkFVDd6 bGQFUInnuDtOjC9rbqpcJrph0v3pt5GHO7DWxD4XbxY3V/h+gEkN5AoCBfMUHgGzvo/c iV9ePsA7g9xPCJWwDQoj9nGd6jCRHRj+A+N48+h/OmZ2cPDCq5ZSZYPJscXfA6MXY+ay fYxw== X-Received: by 10.180.105.65 with SMTP id gk1mr11527997wib.12.1393187076828; Sun, 23 Feb 2014 12:24:36 -0800 (PST) Received: from [10.0.1.151] ([213.106.240.92]) by mx.google.com with ESMTPSA id v6sm17497605wif.0.2014.02.23.12.24.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 23 Feb 2014 12:24:36 -0800 (PST) Message-ID: <530A590B.2040004@gmail.com> Date: Sun, 23 Feb 2014 20:24:43 +0000 From: Matej Kosik <5764c029b688c1c0d24a2e97cd764f@gmail.com> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131103 Icedove/17.0.10 MIME-Version: 1.0 To: caml-list@inria.fr References: <5309E82E.5060802@gmail.com> In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] how to convert strings to Ocaml values at run-time? On 23/02/14 13:12, Tianyi Cui wrote: > If you know the type of this string in advance, you can do so with ocaml_plugin: https://github.com/janestreet/ocaml_plugin Hm, imagine that the expected type is: 'a * 'a -> bool Now, if user provides a string, say: "fun (a,b) -> a = b" how can I convert that string to Ocaml value of the above type (like how toplevel does it)? Is this something ocaml_plugin is able to do for me? I've failed to figure out the trick.