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 AAA27028; Tue, 27 Apr 2004 00:32:43 +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 AAA26003 for ; Tue, 27 Apr 2004 00:32:41 +0200 (MET DST) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.186]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i3QMWeYM029532 for ; Tue, 27 Apr 2004 00:32:40 +0200 Received: from [212.227.126.160] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1BIEeU-0008IJ-00; Tue, 27 Apr 2004 00:32:38 +0200 Received: from [80.129.114.89] (helo=gate.gerd-stolpmann.de) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 1BIEeU-0004nk-00; Tue, 27 Apr 2004 00:32:38 +0200 Received: from ice.gerd-stolpmann.de (ice.gerd-stolpmann.de [192.168.0.13]) by gate.gerd-stolpmann.de (Postfix) with ESMTP id 2A6A457C7; Tue, 27 Apr 2004 00:32:38 +0200 (CEST) Received: by ice.gerd-stolpmann.de (Postfix, from userid 1000) id 5FB5FB032; Tue, 27 Apr 2004 00:32:36 +0200 (CEST) Subject: Re: [Caml-list] Re: Common IO structure From: Gerd Stolpmann To: John Goerzen Cc: Nicolas Cannasse , Yamagata Yoriyuki , caml-list@inria.fr In-Reply-To: <20040426211413.GA19147@excelhustler.com> 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> <20040426211413.GA19147@excelhustler.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1083018754.8844.353.camel@ice.gerd-stolpmann.de> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Tue, 27 Apr 2004 00:32:36 +0200 X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:a6865a839c0178d9aa0ce41878507ea2 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 gerd:01 stolpmann:01 2004:99 2004:99 gerd:01 stolpmann:01 incompatible:01 descriptor:01 descriptor:01 api:01 model:01 api:01 model:01 viktoriastr:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Mon, 2004-04-26 at 23:14, John Goerzen wrote: > On Mon, Apr 26, 2004 at 10:56:59PM +0200, Gerd Stolpmann wrote: > > I would suggest to adopt the names "input", "output", "close_in", > > "close_out" of the standard library, as users are already familiar with > > them, and this functionality is already quite powerful. Of course, this > > is only reasonable for byte channels, not for Unicode channels. > > Don't those names seem incompatible with read/write files and > bidirectional channels such as network sockets? Why? > (Ok, so close_in and close_out could be mapped to shutdown(2) in the > latter case, but I very much suspect that would NOT be what a programmer > woudl suspect...) That depends on what the object represents. In Unix, shutdown(2) refers to the connection whereas close(2) refers to the descriptor. That means, one can close one half of a connection, but not one half of a descriptor. I think this is a deficiency of the Unix API (which has historical reasons, bidirectional pipes were added late). As OO channels are not limited to file descriptors, I don't see why we should model them strictly after the Unix API. Separating close_in and close_out has the advantage that input and output behaviour can be really independent, and it is simpler to inherit input and output behaviour from different superclasses. When mapping to Unix, one can implement the rule that the descriptor is closed when both directions are closed. With only one "close" for both directions, one cannot model bidirectional channels without additional methods like "shutdown". Gerd -- ------------------------------------------------------------ Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany gerd@gerd-stolpmann.de http://www.gerd-stolpmann.de ------------------------------------------------------------ ------------------- 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