From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id MAA28540; Mon, 16 Sep 2002 12:07:43 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id MAA28058 for caml-list@pauillac.inria.fr; Mon, 16 Sep 2002 12:07:43 +0200 (MET DST) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA14689 for ; Fri, 13 Sep 2002 17:50:20 +0200 (MET DST) Received: from orinoco.alve.com (orinoco.alve.com [209.99.70.2]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g8DFoI113298 for ; Fri, 13 Sep 2002 17:50:19 +0200 (MET DST) Received: from yahoo.com (mattwb@valery4.alve.com [209.99.70.98]) by orinoco.alve.com (8.11.6/8.11.6) with ESMTP id g8DF5Jj28259 for ; Fri, 13 Sep 2002 10:05:19 -0500 Message-ID: <3D8209C8.2020604@yahoo.com> Date: Fri, 13 Sep 2002 10:52:40 -0500 From: Matt Boyd User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020606 X-Accept-Language: en-us, en MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: [Caml-list] Setting the EOL character.... References: <4D5CA086.356E9A2F.00958B05@netscape.net> <000401c25ace$6896c7b0$0a00a8c0@stone> <200209131533.g8DFXwK30934@waco.inria.fr> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Bruno.Verlyck@inria.fr wrote: > From: "Richard Lyman" > Date: Thu, 12 Sep 2002 20:36:45 -0600 > > ... so then - there's no OCaml concept of a global EOL variable, or > method that deals with reading in from a stream until the EOL?? > I make no promises of efficiency or thread safety, but this should do what you want: let read_until n = let buf = Buffer.create 100 in fun st -> let rec aux = function | n' when n' = n -> let str = Buffer.contents buf in Buffer.reset buf; str | n' -> Buffer.add_char buf n'; aux (Stream.next st); in aux (Stream.next st) let read_until_null = read_until '\000' > > Bruno. > ------------------- > To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr > Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > > ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners