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 QAA24811; Mon, 26 Apr 2004 16:24:03 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA22846 for ; Mon, 26 Apr 2004 16:24:02 +0200 (MET DST) Received: from postfix3-1.free.fr (postfix3-1.free.fr [213.228.0.44]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i3QEO1jq014722 for ; Mon, 26 Apr 2004 16:24:01 +0200 Received: from warp (lns-th2-5f-81-56-197-80.adsl.proxad.net [81.56.197.80]) by postfix3-1.free.fr (Postfix) with SMTP id 0A2B1C448D; Mon, 26 Apr 2004 16:24:00 +0200 (CEST) Message-ID: <015701c42b9a$00065730$ef01a8c0@warp> From: "Nicolas Cannasse" To: "Yamagata Yoriyuki" Cc: References: <007501c429de$7aee90b0$19b0e152@warp><20040425.175623.71081314.yoriyuki@mbg.ocn.ne.jp><00cb01c42afd$7fc1b430$19b0e152@warp> <20040426.221606.71081508.yoriyuki@mbg.ocn.ne.jp> Subject: Re: [Caml-list] Re: Common IO structure Date: Mon, 26 Apr 2004 16:23:09 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 X-Miltered: at nez-perce by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; cannasse:01 warplayer:01 caml-list:01 extlib:01 camomile:01 extlib:01 wrappers:01 outputs:01 wrappers:01 char:01 outputs:01 char:01 buffer:01 buffer:01 val:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > > 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. [...] > I'm interested in your opinion (and of all caml list participants). Did you had a look at my OO wrappers proposal for IO module (posted on ExtLib mailling list) ? Some infos for people who doesn't know about ExtLib IO module : ExtLib IO library is bi-polymorphic for performances reasons : it as two polymorphic types parameters. A file input for example is a (char,string) IO.input so there is two things we can write : chars and strings. Outputs have a third parameter that is "what is returned by the close function" : a file output is a (char,string,unit) IO.ouput , and a buffer output is a (char,string,string) IO.output (the contents of the buffer is returned when the ouput is closed). here's how are created IOs : 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 ? Best Regards, Nicolas Cannasse ------------------- 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