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 VAA09996; Tue, 27 Apr 2004 21:11:11 +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 VAA09955 for ; Tue, 27 Apr 2004 21:10:35 +0200 (MET DST) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from postfix3-2.free.fr (postfix3-2.free.fr [213.228.0.169]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i3RJAXYM006858 for ; Tue, 27 Apr 2004 21:10:33 +0200 Received: from warp (chateaudeau-4-82-225-176-25.fbx.proxad.net [82.225.176.25]) by postfix3-2.free.fr (Postfix) with SMTP id 52856C199; Tue, 27 Apr 2004 21:10:31 +0200 (CEST) Message-ID: <007a01c42c8b$00941ec0$19b0e152@warp> From: "Nicolas Cannasse" To: "Gerd Stolpmann" Cc: "Yamagata Yoriyuki" , References: <00cb01c42afd$7fc1b430$19b0e152@warp> <20040426.221606.71081508.yoriyuki@mbg.ocn.ne.jp> <015701c42b9a$00065730$ef01a8c0@warp> <20040427.002643.78700697.yoriyuki@mbg.ocn.ne.jp> <016401c42bc4$b6438840$19b0e152@warp> <1083013017.8842.327.camel@ice.gerd-stolpmann.de> Subject: Re: [Caml-list] Re: Common IO structure Date: Tue, 27 Apr 2004 21:08:18 +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.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 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; cannasse:01 warplayer:01 caml-list:01 extlib:01 camomile:01 ocamlnet:01 extlib:01 paraphrase:01 non-issue:01 behave:01 char:01 char:01 additionnal:01 ocamlnet:01 convincing:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > > > 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. > > > > So ? That's exactly what we're talking about it there : making a choice. And > > that include naming of course. I don't say that the name we choosed for > > ExtLib IO are better, it's just that "reading" and "writing" on an IO seems > > natural to me. > > That sounds like a paraphrase for "better" without using this word. I > would like to hear real arguments for why certain names should be used. > For example, one reason can be that there is already a user base. > > I think names are just names, and there are usually several ways of > referring to things. However, when several independent libraries > _choose_ to name their methods in a coherent way, I would say this is > very intelligent. I agree with you. Let's agree on something consistent : naming is a non-issue. > > > 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. > > > > That's true, I agree with you but on the last point : they are necessary in > > order to get good performances. Concerning "available", it returns None if > > no data available. "pos" might throw an exception as well when unavailable > > (looks like pos and available should have same behavior here). And > > nread/nwrite can simply call n times read/write. That means that any library > > can put default implementation for additional "not minimal" constructs : > > they will behave poorly (writing a string char by char) but will interface > > well with other IO that are supporting them correctly. If implementing > > efficently nread/nwrite require additionnal effort, then let's implement a > > default behavior and implement it better later. Having theses functions make > > room for future improvements, which is not done with minimal IO. > > Guess what? ocamlnet implements all that in a convincing way. Read its > introduction to OO wrappers for I/O: > > http://ocamlnet.sourceforge.net/intro/netchannels.html We're actually quite near to agree on what should be the minimal requirements. Looks like you included pos_in / pos_out into the "fundamentals methods" , would you agree to drop theses ? In short, I think we all want different things : - Yamagata Yoriyuki want IO to be on a char basis (and that makes sense for Unicode) - you would prefer having buffered channels (and that make sense for network protocols, parsing, ...) - I propose that we have two way of accessing the channel, that can be buffered or unbuffered, or others. I think this is enough general to cover a lot of different usage, and introduce some interesting polymorphism. I would like to get your opinion on that. 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