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 QAA12450; Fri, 27 Sep 2002 16:50:54 +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 QAA12461 for ; Fri, 27 Sep 2002 16:50:53 +0200 (MET DST) Received: from grisu.bik-gmbh.de (In-Planung---------X.BIK-GmbH.de [212.12.55.66] (may be forged)) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g8REoq524452 for ; Fri, 27 Sep 2002 16:50:52 +0200 (MET DST) Received: from hars.de (prony.bik-gmbh.de [194.233.237.133]) by grisu.bik-gmbh.de (8.12.3/8.12.3) with ESMTP id g8REopU8024720; Fri, 27 Sep 2002 16:50:51 +0200 (CEST) (envelope-from florian@hars.de) Message-ID: <3D947045.9030009@hars.de> Date: Fri, 27 Sep 2002 16:50:45 +0200 From: Florian Hars User-Agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.1) Gecko/20020826 X-Accept-Language: de-de, en-us, en MIME-Version: 1.0 To: "Kontra, Gergely" CC: caml-list@inria.fr Subject: Re: [Caml-list] (Sorry for my last post) lazyness, exceptions?, ocaml syntax rule-of-thumbs References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Kontra, Gergely wrote: > One point was ocaml is really obscure is the file reading: it needed to > wrap the line-reading in an infinite loop, and this loop is ended via an > exception. I think End_of_file is not an exception, it is just an event. For processing files a line at a time, I once decided to write a module Textfile with the two methods val iter : (string -> unit) -> in_channel -> unit val fold : ('a -> string -> 'a) -> 'a -> in_channel -> 'a and forget about whatever ugly things happen in there. 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