From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id A8CF1BC69 for ; Mon, 2 Jul 2007 04:10:41 +0200 (CEST) Received: from ipmail03.adl2.internode.on.net (ipmail03.adl2.internode.on.net [203.16.214.135]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l622Adt6013477 for ; Mon, 2 Jul 2007 04:10:40 +0200 X-IronPort-AV: E=Sophos;i="4.16,484,1175437800"; d="scan'208";a="110254729" Received: from ppp121-44-3-31.lns4.syd7.internode.on.net (HELO [192.168.1.201]) ([121.44.3.31]) by ipmail03.adl2.internode.on.net with ESMTP; 02 Jul 2007 11:40:35 +0930 Subject: Re: [Caml-list] unix.select + camlp4 From: skaller To: Anastasia Gornostaeva Cc: caml-list@inria.fr In-Reply-To: <20070701210125.GB4434@ermine.home> References: <20070701203044.GA4434@ermine.home> <200707012137.46921.jon@ffconsultancy.com> <20070701210125.GB4434@ermine.home> Content-Type: text/plain Date: Mon, 02 Jul 2007 12:10:34 +1000 Message-Id: <1183342234.15100.6.camel@rosella.wigram> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 46885E9F.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; camlp:01 0100,:01 parses:01 non-blocking:01 parser:01 parser:01 sourceforge:01 parsing:01 wrote:01 wrote:01 unix:01 caml-list:01 module:03 stream:04 jul:04 On Mon, 2007-07-02 at 01:01 +0400, Anastasia Gornostaeva wrote: > On Sun, Jul 01, 2007 at 09:37:46PM +0100, Jon Harrop wrote: > I dont understand: Try: > 1) It receives "1-2+3*" and parses it. > 2) Later it receives "4" and continues parsing. > > I want to get non-blocking parser. How to implement? Put the parser in a thread, select in another thread. Use Stream.from f for the parser. Write f to get characters using the Event module, send the characters from the other thread after select makes a channel active. -- John Skaller Felix, successor to C++: http://felix.sf.net