From: Nicolas C. <war...@fr...> - 2004-01-26 12:07:24
|
> Just two comments. > > > exception No_more_input > > Why not just End_of_file? We're talking here about abstract IO, that means that the underlying "item" we're reading from can be a file, or a string, or anything else... > val read : ('a, 'b) input -> 'a > val nread : ('a, 'b) input -> int -> 'b > val available : ('a, 'b) input -> int option > val close_in : ('a, 'b) input -> unit > > val seek : ('a, 'b) input -> int -> unit; > val pos : ('a, 'b) input -> int; > > or, rather, define two input types: a sequential one and one with random > access. Theses two looks ok and could be added, but we need more closures to implement them in an abstract way and we're not sure they can succeed ( seek with negative index on a socket for example ). The semantics is also not clear : for exemple if I create a (string,string list) file-based output and write "HELLO" "WORLD" then I will be able to read "HELLOWORLD" in one time from the corresponding input - that means that I write 2 strings and read 1. Seek and pos units are based on a "character" unit , while we're working here with a more abstract "token" type. Regards, Nicolas Cannasse |