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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 036FB7F0AB for ; Thu, 23 Mar 2017 14:57:43 +0100 (CET) Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=paul.lachat@edu.univ-fcomte.fr; spf=SoftFail smtp.mailfrom=paul.lachat@edu.univ-fcomte.fr; spf=None smtp.helo=postmaster@ufc-sortie.univ-fcomte.fr Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of paul.lachat@edu.univ-fcomte.fr) identity=pra; client-ip=194.57.91.199; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="paul.lachat@edu.univ-fcomte.fr"; x-sender="paul.lachat@edu.univ-fcomte.fr"; x-conformance=sidf_compatible Received-SPF: SoftFail (mail3-smtp-sop.national.inria.fr: domain of paul.lachat@edu.univ-fcomte.fr is inclined to not designate 194.57.91.199 as permitted sender) identity=mailfrom; client-ip=194.57.91.199; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="paul.lachat@edu.univ-fcomte.fr"; x-sender="paul.lachat@edu.univ-fcomte.fr"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@ufc-sortie.univ-fcomte.fr) identity=helo; client-ip=194.57.91.199; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="paul.lachat@edu.univ-fcomte.fr"; x-sender="postmaster@ufc-sortie.univ-fcomte.fr"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3AvZo6fB+ld747JP9uRHKM819IXTAuvvDOBiVQ1KB2?= =?us-ascii?q?0+4cTK2v8tzYMVDF4r011RmSDNmds6oMotGVmpioYXYH75eFvSJKW713fDhBt/?= =?us-ascii?q?8rmRc9CtWOE0zxIa2iRSU7GMNfSA0tpCnjYgBaF8nkelLdvGC54yIMFRXjLwp1?= =?us-ascii?q?Ifn+FpLPg8it2e2//5Lebx9UiDahfLh/MAi4oQLNu8cMnIBsMLwxyhzHontJf+?= =?us-ascii?q?RZ22ZlLk+Nkhj/+8m94odt/zxftPw9+cFAV776f7kjQrxDEDsmKWE169b1uhTF?= =?us-ascii?q?UACC+2ETUmQSkhpPHgjF8BT3VYr/vyfmquZw3jSRMNboRr4oRzut86ZrSAfpiC?= =?us-ascii?q?gZMT457HrXgdF0gK5CvR6tuwBzz4vSbYqINvRxY7ndcMsUS2RBQMhfVC5OAo2h?= =?us-ascii?q?YYQAE+UPMudYoY7hp1YVsRuzBxWjCP/1xzNUhHL727Ax3eQ7EQHB2QwtB8oOv2?= =?us-ascii?q?7JrNXxLqsSVfq6w7XIzTrZc/Nbwiny55XVchw7vPGMW7NwcdTIxUkhCwzFiVCQ?= =?us-ascii?q?qZD7MD+P2OQNqW6W5PdjW+K3k2MrtgV8rze1ysosiITFnIYYxk3e+SlkxIs4Ic?= =?us-ascii?q?W0RFN/bNOrCpdcqiCXOolsTs4tQ2xkojg2x70etZKmeCUHx44ryh7dZvCdd4WE?= =?us-ascii?q?/wjvWPiNLTp3gn9uZaixiAyo8Ue6z+3xTsm030hOripCitTMq34N2ADK5sicTf?= =?us-ascii?q?t95Fuh2TeR2AzJ9+FEJ0E0lbTCJ54v3rEwkZ8TsVjdESPslkX2lreadkQi+ue2?= =?us-ascii?q?9+Tqeqjqq5uTOoNuigzzML4il8iiDegiLwQDW2yW9fy51LL5/E35RLtKjucxkq?= =?us-ascii?q?ncqJ3aPd4UprO9AwNP1oYs8QqwDze839QEhnQIMk9KeA+dg4j0PVHOIe74Ae6x?= =?us-ascii?q?g1uwlzdrwuzGMaP7DpXDNHjPiK3hcqpl605A1AozyshS54lUCrEAJvL8R1H+tM?= =?us-ascii?q?bGARIiMg20wuPnB85n1owEQ26PA6mZMLnTsVCS/O4vLfOMbpcPuDnhM/gl++Lu?= =?us-ascii?q?jXghlFABZ6ap2J8XZGm8HvRnOEWZfWHhgswBEGcPpgoxVvbmiFyEUT5JZna9Rb?= =?us-ascii?q?gw5j8hCNHuMYCWfQGniaed3Sq9Vr1XYGxLEF2WWSPTeo+NQOsNZSTUAs5nnjEe?= =?us-ascii?q?WKKJSok71BjouhWsmJR9Ke+B4iQFsdTn3dN17vH7mB0vsyFyDtrY3WqKSn152G?= =?us-ascii?q?0SFGx+57x2vUEokgTL6qN/mfENUIULv/4=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0D8BwCD09NYh8dbOcJdGwEBAQMBAQEJA?= =?us-ascii?q?QEBFwEBBAEBCgEBhRmDW4sCkD2VaYINhiICgxVGEQEBAQEBAQEBAQEBEgEBAQo?= =?us-ascii?q?LCQgoL0IOgWMiAYJAAwMjVhACAQgaAg0ZAgJXAgSKHapngiaKPwEBAQEBAQQBA?= =?us-ascii?q?QEBAQEigQuHUIJihHGCaYJfBZxVlEWJAYYzk2I5BIEeXVKEaYFwhwWCawGBDAE?= =?us-ascii?q?BAQ?= X-IPAS-Result: =?us-ascii?q?A0D8BwCD09NYh8dbOcJdGwEBAQMBAQEJAQEBFwEBBAEBCgE?= =?us-ascii?q?BhRmDW4sCkD2VaYINhiICgxVGEQEBAQEBAQEBAQEBEgEBAQoLCQgoL0IOgWMiA?= =?us-ascii?q?YJAAwMjVhACAQgaAg0ZAgJXAgSKHapngiaKPwEBAQEBAQQBAQEBAQEigQuHUIJ?= =?us-ascii?q?ihHGCaYJfBZxVlEWJAYYzk2I5BIEeXVKEaYFwhwWCawGBDAEBAQ?= X-IronPort-AV: E=Sophos;i="5.36,210,1486422000"; d="scan'208";a="217778385" Received: from ufc-sortie.univ-fcomte.fr ([194.57.91.199]) by mail3-smtp-sop.national.inria.fr with ESMTP; 23 Mar 2017 14:57:43 +0100 Received: from ufc204.univ-fcomte.fr (ufc204.univ-fcomte.fr [194.57.91.204]) by ufc-sortie.univ-fcomte.fr (Postfix) with ESMTP id 11B37609A0; Thu, 23 Mar 2017 14:57:43 +0100 (CET) Received: from zstore04.univ-fcomte.fr (localhost.localdomain [127.0.0.1]) by ufc204.univ-fcomte.fr (Postfix) with ESMTP id EBBAD8E49; Thu, 23 Mar 2017 14:57:42 +0100 (CET) Date: Thu, 23 Mar 2017 14:57:42 +0100 (CET) From: paul.lachat@edu.univ-fcomte.fr To: =?utf-8?Q?S=C3=A9bastien?= Hinderer Cc: caml-list@inria.fr Message-ID: <1474510167.9307838.1490277462820.JavaMail.zimbra@edu.univ-fcomte.fr> In-Reply-To: <20170323134121.cuclsd52clhmra3z@pema> References: <1590236478.9253508.1490261850094.JavaMail.zimbra@edu.univ-fcomte.fr> <20170323130207.udjaxrejqmdkvjfq@pl-59055.rocqadm.inria.fr> <880456179.9300684.1490275600601.JavaMail.zimbra@edu.univ-fcomte.fr> <20170323134121.cuclsd52clhmra3z@pema> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [194.167.45.25] X-Mailer: Zimbra 8.6.0_GA_1200 (ZimbraWebClient - FF52 (Linux)/8.6.0_GA_1200) Thread-Topic: Loading .ml in memory to interact with them. Thread-Index: VQF7rrsa2ISpxz8EEfdUowEOply5wg== Subject: Re: [Caml-list] [Question] Loading .ml in memory to interact with them. I've tried : In one shell : ocaml < /tmp/pipe_in > /tmp/pipe_out In another shell : tail -f /tmp/pipe_out & cat << EOF > /tmp/pipe_in heredoc> 1+1;; heredoc> let x = 10;; heredoc> let y = 15;; heredoc> x;; heredoc> y;; heredoc> EOF (feedback of tail) OCaml version 4.03.0 # - : int = 2 # val x : int = 10 # val y : int = 15 # - : int = 10 # - : int = 15 # ____ But that's not what I want. I want to be able to have this kind of logic : 1- Launch the ocaml toplevel. 2- The toplevel wait an instruction. 3- Send one instruction. 4- Get the result of the instruction. 5- Go back to 2- until we send "#quit;;". I know that when you type ctrl-d in the toplevel it stop. And that ctrl-d is the end-of-file 'keystroke'. But I would like, if possible, to have a persistant tolevel process running. So when I load a file via the #use ".ml";; directive, I can after that, and at any time, call function of the .ml and get the result display by the toplevel. It would be better than always re-read the file to get the result of a function (for example).