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] [ANN] The Missing Library
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-04-26 (13:16)
From: Yamagata Yoriyuki <yoriyuki@m...>
Subject: [Caml-list] Re: Common IO structure
From: "Nicolas Cannasse" <>
Subject: Re: Common IO structure (was Re: [Caml-list] [ANN] The Missing Library)
Date: Sun, 25 Apr 2004 21:42:52 +0200

> I see your point, tell me if I'm wrong :
> You would like to add ExtLib IO's support to Camomile, without actually the
> need for the user to install ExtLib in order to compile your library. You're
> true about that, and that's a good idea. I'll try to think about adding some
> OO wrappers on ExtLib IO, as well as conversion functions from/to ExtLib
> input/outputs objects and records before next release.

What I want is more than that.  I want that we agree some minimal set
of methods for IO channles, and agree to accept such an IO channel as
an argument for our library functions, or provide a converter to a
native IO channel of the library.

For a polymorphic channel, minimal class types would be

(for input)
['a] object get : unit -> 'a end 
(raise End_of_file when there is no more element to read.)

(for output)
['a] object 
     put : 'a -> unit 
     flush : unit -> unit 
     close : unit -> unit

for a character channel,
(for input)
object input : string -> int -> int -> int end

([c#input s pos len] fills s from pos with less than [len] characters,
and returns the number of characters really filled.)

(for output)
       output : string -> int -> int -> unit
       flush : unit -> unit
       close : unit -> unit
([c#output s pos len] outputs [len] characters from the position

I'm interested in your opinion (and of all caml list participants).
Yamagata Yoriyuki

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: