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 RAA31945; Mon, 26 Apr 2004 17:26:51 +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 RAA32318 for ; Mon, 26 Apr 2004 17:26:50 +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 i3QFQmYM002590 for ; Mon, 26 Apr 2004 17:26:49 +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 646B65D16; Tue, 27 Apr 2004 00:26:46 +0900 (JST) Date: Tue, 27 Apr 2004 00:26:43 +0900 (JST) Message-Id: <20040427.002643.78700697.yoriyuki@mbg.ocn.ne.jp> To: warplayer@free.fr Cc: caml-list@inria.fr Subject: Re: [Caml-list] Re: Common IO structure From: Yamagata Yoriyuki In-Reply-To: <015701c42b9a$00065730$ef01a8c0@warp> References: <00cb01c42afd$7fc1b430$19b0e152@warp> <20040426.221606.71081508.yoriyuki@mbg.ocn.ne.jp> <015701c42b9a$00065730$ef01a8c0@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 concorde by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 yamagata:01 yoriyuki:01 yoriyuki:01 cannasse:01 warplayer:01 caml-list:01 2004:99 val:01 val:01 wrappers:01 outputs:01 wrappers:01 developpers:01 extlib:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk From: "Nicolas Cannasse" Subject: Re: [Caml-list] Re: Common IO structure Date: Mon, 26 Apr 2004 16:23:09 +0200 > val create_in : > read:(unit -> 'a) -> > nread:(int -> 'b) -> > pos:(unit -> int) -> > available:(unit -> int option) -> close:(unit -> unit) -> ('a, 'b) input > > val create_out : > write:('a -> unit) -> > nwrite:('b -> unit) -> > pos:(unit -> int) -> > flush:(unit -> unit) -> close:(unit -> 'c) -> ('a, 'b, 'c) output > > the "minimal set of methods" is 5 methods for both. > The OO wrappers I proposed are doing exactly what you want , they're > converting from and to IO input/outputs. Could you explain what part of the > problem they're not answering ? You miss my point. What I propose is having agreement over I/O channels. So, having OO wrappers only solves the half of our problems. Another half is whether or not developpers accept them. And from my point of view, your proposal has some problems. For one thing, it is not compatible to the already existing I/O channels in other libraries than Extlib. Camomile uses get and put for your read and write, and ocamlnet and cryptokit uses input and output (IIRC) for your nread and nwrite. Another problem is that it is not minimal enough. For character converters, it is impossible to predict how many characters will be available, for example. And requiring "pos", "nread", "nwrite" seems arbitrary for me. They are somtimes useful and improvement, but not necessary. Since I want that these interfaces are accepted as the common standard, I wanted that the requirement is absolutely minimal. My proposal in the previous mail is inspired by the view that channels are co-inductive types defined by its constructer and consumer. Without those methods, they are not channels any more. I'm interested in your opinion. -- 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