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 QAA23698; Tue, 18 Mar 2003 16:21:44 +0100 (MET) 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 QAA24017 for ; Tue, 18 Mar 2003 16:21:42 +0100 (MET) Received: from grisu.bik-gmbh.de (grisu.bik-gmbh.de [217.110.154.194]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h2IFLff17776 for ; Tue, 18 Mar 2003 16:21:41 +0100 (MET) Received: from bik-gmbh.de (prony.bik-gmbh.de [194.233.237.133]) by grisu.bik-gmbh.de (8.12.6/8.12.6) with ESMTP id h2IFLdDo030858; Tue, 18 Mar 2003 16:21:39 +0100 (CET) (envelope-from hars@bik-gmbh.de) Message-ID: <3E77397E.6040400@bik-gmbh.de> Date: Tue, 18 Mar 2003 16:21:34 +0100 From: Florian Hars User-Agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, de-de, en MIME-Version: 1.0 To: Oliver Bandel CC: caml-list@inria.fr Subject: Re: [Caml-list] Loop times References: <20030318085232.GB372@first.in-berlin.de> In-Reply-To: <20030318085232.GB372@first.in-berlin.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, hits=-4.5 required=5.0 tests=IN_REP_TO,REFERENCES,SPAM_PHRASE_00_01,SUBJECT_IS_LIST, USER_AGENT,USER_AGENT_MOZILLA_UA,X_ACCEPT_LANG version=2.41 X-Spam: no; 0.00; florian:01 hars:01 bik-gmbh:01 caml-list:01 oliver:01 bandel:01 nonetheless:01 stow:01 textfile:01 wrote:03 arguments:03 iter:03 let:04 ugly:05 functions:05 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Oliver Bandel wrote: > What does this mean for such a version of reading a file > linewise into a list of strings? Nothing. I/O usually isn't CPU-bound. You may argue that this idiom looks ugly nonetheless, but this is why you stow it away in some utility functions, called Textfile.iter and Textfile.fold (anyone round here who has not writeen these?). So your code looks something like let input_lines chan = List.rev (Textfile.fold (::) chan []) or so, depending on how you order the arguments. Yours, Florian. ------------------- 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