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 SAA30594; Tue, 27 Apr 2004 18:01:10 +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 SAA30301 for ; Tue, 27 Apr 2004 18:01:08 +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 i3RG16YM012387 for ; Tue, 27 Apr 2004 18:01:07 +0200 Received: from localhost (p34096-adsau14honb7-acca.tokyo.ocn.ne.jp [220.111.84.96]) by smtp.mbg.ocn.ne.jp (Postfix) with ESMTP id 73ED154D6; Wed, 28 Apr 2004 01:01:05 +0900 (JST) Date: Wed, 28 Apr 2004 01:00:33 +0900 (JST) Message-Id: <20040428.010033.85418284.yoriyuki@mbg.ocn.ne.jp> To: info@gerd-stolpmann.de Cc: warplayer@free.fr, caml-list@inria.fr Subject: Re: [Caml-list] Re: Common IO structure From: Yamagata Yoriyuki In-Reply-To: <1083013017.8842.327.camel@ice.gerd-stolpmann.de> References: <20040427.002643.78700697.yoriyuki@mbg.ocn.ne.jp> <016401c42bc4$b6438840$19b0e152@warp> <1083013017.8842.327.camel@ice.gerd-stolpmann.de> 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 gerd:01 stolpmann:01 caml-list:01 2004:99 ocamlnet:01 char:01 camomile:01 char:01 camomile:01 ocamlnet:01 atom:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk From: Gerd Stolpmann Subject: Re: [Caml-list] Re: Common IO structure Date: Mon, 26 Apr 2004 22:56:59 +0200 > Of course, sharing the same method name is possible, in ocamlnet we have > e.g. output_char where camomile has put_char. So the question is whether > this is worth the effort. Camomile uses "put", not "put_char", because channels are polymorphic. If ocamlnet channels have input/output for strings, but have output_char for one Unicode character, then I would say output_char is different from Camomile "put", because Camomile "put" is supposed to output one atom (for character channles, atom is char, not a Unicode character.) Since I am convinced by Gerd's argument for close_in/close_out, I updates my proposal as (for input) ['a] object get : unit -> 'a close_in : unit end (raise End_of_file when there is no more element to read.) (for output) ['a] object put : 'a -> unit flush : unit -> unit close_out : unit -> unit end for a character channel, (for input) object input : string -> int -> int -> int close_in : unit 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_out : unit -> unit end ([c#output s pos len] outputs [len] characters from the position [pos]) But the distinction of put/input, get/output may be confusing. Hmmm. ------------------- 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