Version française
Home     About     Download     Resources     Contact us    
Browse thread
unix.select + camlp4
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] unix.select + camlp4
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 <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net