Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] newbie type problem
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-10-29 (08:03)
From: Dustin Sallings <dustin@s...>
Subject: Re: [Caml-list] newbie type problem

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 Archives:
Bug reports: FAQ:
Beginner's list: