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 E26327F0AB for ; Thu, 23 Mar 2017 14:02:07 +0100 (CET) X-IronPort-AV: E=Sophos;i="5.36,209,1486422000"; d="scan'208";a="217769632" Received: from pl-59055.paris.inria.fr (HELO pl-59055.rocqadm.inria.fr) ([128.93.64.92]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/AES256-GCM-SHA384; 23 Mar 2017 14:02:07 +0100 Received: from shindere by pl-59055.rocqadm.inria.fr with local (Exim 4.88) (envelope-from ) id 1cr2NT-0007nT-DL for caml-list@inria.fr; Thu, 23 Mar 2017 14:02:07 +0100 Date: Thu, 23 Mar 2017 14:02:07 +0100 From: =?utf-8?Q?S=C3=A9bastien?= Hinderer To: caml-list@inria.fr Message-ID: <20170323130207.udjaxrejqmdkvjfq@pl-59055.rocqadm.inria.fr> Mail-Followup-To: caml-list@inria.fr References: <1590236478.9253508.1490261850094.JavaMail.zimbra@edu.univ-fcomte.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1590236478.9253508.1490261850094.JavaMail.zimbra@edu.univ-fcomte.fr> Subject: Re: [Caml-list] [Question] Loading .ml in memory to interact with them. Dear Paul, paul.lachat@edu.univ-fcomte.fr (2017/03/23 10:37 +0100): > Hello, > > I need to find a way to put Ocaml program in memory so I could interact with the program > (call function, get result, find information about the variables, ...) without always reading the file. > > That what append when we use the directive #use "file.ml";; in the interactive shell (the toplevel, when you type the command ocaml in a shell). > > The instruction need to come from a Matlab function. So, I was thinking to create a process who run the ocaml command, > redirect his standard input in a named pipe, redirect his standard output in another named pipe, so I could send instructions and received responses. > > But when I send the first instruction (ex : #use "file.ml";;\n), the > ocaml process send back the response and stop. What do you mean by "stops"? Do you mean that it exits? That it does not respond to further commands? Does this happen when you run the process that calls the toplevel inside of mathlab, or did you try all this outside of the mathlab context? Sébastien.