Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
From: Jacques GARRIGUE <garrigue@k...>
Subject: Re: [Caml-list] Re: Common IO structure
From: Yamagata Yoriyuki <yoriyuki@mbg.ocn.ne.jp>

> 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 output)
> object 
>        output : string -> int -> int -> unit
>        flush : unit -> unit
>        close : unit -> unit
> end
> ([c#output s pos len] outputs [len] characters from the position
> [pos])

All this seems reasonable.
Note that Format also uses [spaces] and [newline], but there are
reasonable defaults for them.

This also emphasizes one of the advantages of objects: since their
types can be compared for equality, several libraries can use the same
type without requiring a common header (that is, if everybody agrees
on the interface, as you suggest).

     Jacques Garrigue

-------------------
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