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 PAA19380; Mon, 26 Apr 2004 15:16:19 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id PAA19519 for ; Mon, 26 Apr 2004 15:16:18 +0200 (MET DST) Received: from smtp.mbg.ocn.ne.jp (mbg.ocn.ne.jp [210.190.142.181]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i3QDGHYM013848 for ; Mon, 26 Apr 2004 15:16:17 +0200 Received: from localhost (p21109-adsau12honb7-acca.tokyo.ocn.ne.jp [220.99.25.109]) by smtp.mbg.ocn.ne.jp (Postfix) with ESMTP id 7BFF163A4; Mon, 26 Apr 2004 22:16:15 +0900 (JST) Date: Mon, 26 Apr 2004 22:16:06 +0900 (JST) Message-Id: <20040426.221606.71081508.yoriyuki@mbg.ocn.ne.jp> To: warplayer@free.fr Cc: caml-list@inria.fr Subject: [Caml-list] Re: Common IO structure From: Yamagata Yoriyuki In-Reply-To: <00cb01c42afd$7fc1b430$19b0e152@warp> References: <007501c429de$7aee90b0$19b0e152@warp> <20040425.175623.71081314.yoriyuki@mbg.ocn.ne.jp> <00cb01c42afd$7fc1b430$19b0e152@warp> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Miltered: at = by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; yamagata:01 yoriyuki:01 yoriyuki:01 cannasse:01 warplayer:01 caml-list:01 2004:99 extlib:01 camomile:01 extlib:01 wrappers:01 outputs:01 outputs:01 yamagata:01 caml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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 end 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) 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]) I'm interested in your opinion (and of all caml list participants). -- Yamagata Yoriyuki ------------------- 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