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 OAA14497; Thu, 29 Apr 2004 14:03:45 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 OAA14490 for ; Thu, 29 Apr 2004 14:03:44 +0200 (MET DST) Received: from aomori.annexia.org (annexia.force9.co.uk [212.56.101.183]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i3TC3hYM027580 for ; Thu, 29 Apr 2004 14:03:43 +0200 Received: from rich by aomori.annexia.org with local (Exim 3.36 #1 (Debian)) id 1BJAGU-0002GO-00 for ; Thu, 29 Apr 2004 13:03:42 +0100 Date: Thu, 29 Apr 2004 13:03:42 +0100 Cc: caml-list@inria.fr Subject: Re: [Caml-list] Re: Common IO structure Message-ID: <20040429120342.GB28018@redhat.com> References: <016401c42bc4$b6438840$19b0e152@warp> <20040428.004358.45522587.yoriyuki@mbg.ocn.ne.jp> <016501c42c73$24e64b30$ef01a8c0@warp> <20040428.015800.126758722.yoriyuki@mbg.ocn.ne.jp> <408EEE3E.7050008@socialtools.net> <20040428034415.GB19564@complete.org> <40902265.9040702@socialtools.net> <20040428214442.GE10198@excelhustler.com> <20040428224130.GA30256@redhat.com> <4090EC37.2070200@socialtools.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4090EC37.2070200@socialtools.net> User-Agent: Mutt/1.5.5.1+cvs20040105i From: Richard Jones X-Miltered: at concorde by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 2004:99 encodings:01 type-safe:01 ltd:98 unicode:01 unicode:01 caml:01 caml:01 parser:02 parser:02 eof:02 bytes:02 financial:96 string:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Thu, Apr 29, 2004 at 12:51:19PM +0100, Benjamin Geer wrote: > Richard Jones wrote: > >* What programs do people need to write? > > Most of what I do involves financial messages, which tend to be small, > and come in many different encodings and formats. So what I usually > need to do is read until EOF (from a file, a socket or whatever), > convert the data to a Unicode string, and run it through some kind of > parser (e.g. an XML parser). Going the other way, I have a Unicode > string, and I just want to convert it to bytes and write it to a file or > socket. That covers 90% of what I do with I/O. Actually me too. 90% of my file IO requirement is to slurp a whole file into a string, which suggests that any proposed IO interface which doesn't allow you to do that in a single line is going to be a non-starter: let content = slurp_filename filename in ... Rich. -- Richard Jones. http://www.annexia.org/ http://www.j-london.com/ Merjis Ltd. http://www.merjis.com/ - improving website return on investment Perl4Caml lets you use any Perl library in your type-safe Objective CAML programs. http://www.merjis.com/developers/perl4caml/ ------------------- 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