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 JAA20167; Wed, 29 Oct 2003 09:03:55 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id JAA30261 for ; Wed, 29 Oct 2003 09:03:54 +0100 (MET) Received: from bob.west.spy.net (mail.west.spy.net [66.149.231.226]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h9T83o111390 for ; Wed, 29 Oct 2003 09:03:51 +0100 (MET) Received: from [192.168.42.247] (dhcp-247.wireless.west.spy.net [192.168.42.247]) by bob.west.spy.net (Postfix) with ESMTP id 1759859F1; Wed, 29 Oct 2003 00:03:46 -0800 (PST) In-Reply-To: <3F9F6AE6.9030102@bik-gmbh.de> References: <087CB9D7-05FB-11D8-B1A2-000393DC8AE4@spy.net> <3F9F6AE6.9030102@bik-gmbh.de> Mime-Version: 1.0 (Apple Message framework v606) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <6BC5D6B8-09E6-11D8-B772-000393CFE6B8@spy.net> Content-Transfer-Encoding: 7bit Cc: caml-list@inria.fr From: Dustin Sallings Subject: Re: [Caml-list] newbie type problem Date: Wed, 29 Oct 2003 00:03:46 -0800 To: Florian Hars X-Mailer: Apple Mail (2.606) X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 newbie:01 florian:01 hars:01 textfile:01 cleanup:01 dangling:01 textfile:01 caml:01 ported:02 wrote:03 wrote:03 oct:03 argument:03 scheme:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Oct 28, 2003, at 11:23 PM, Florian Hars wrote: > let parse_logfile filename = > let ic = open_in filename in > let start_events, transactions = > Textfile.fold operate_on_line (M.empty, M.empty) ic in > close_in ic; > cleanup_dangling_events start_events transactions > > let _ = print_transaction_info (parse_logfile "my_logfile") What is Textfile? I wrote something very similar to what I think this is in scheme (from which this thing is being ported somewhat slowly): ; Loop on input, pass each line to function f. ; Optional argument should be either a port, or a filename. If not ; provided, (current-input-port) will be used. (input-loop f . other) ; A conditional input loop (only loop on a line if (c line) is true) (conditional-input-loop c f . other) I'll probably do the same thing in caml when I get this a little more out of the toy phase. Thanks for the input. -- Dustin Sallings ------------------- 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