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 FAA14445; Fri, 30 Apr 2004 05:40:14 +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 FAA14040 for ; Fri, 30 Apr 2004 05:40:12 +0200 (MET DST) Received: from rabelais.socialtools.net (rabelais.socialtools.net [81.2.94.243]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i3TMZlEV008658 for ; Fri, 30 Apr 2004 00:35:47 +0200 Received: by rabelais.socialtools.net (Postfix, from userid 108) id A8DE7232DF; Thu, 29 Apr 2004 23:35:46 +0100 (BST) Received: from socialtools.net (chaucer.socialtools.net [81.2.94.242]) by rabelais.socialtools.net (Postfix) with ESMTP id 93F07232DB; Thu, 29 Apr 2004 23:35:45 +0100 (BST) Message-ID: <40918321.3020705@socialtools.net> Date: Thu, 29 Apr 2004 23:35:13 +0100 From: Benjamin Geer User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-gb, en, fr, it MIME-Version: 1.0 To: John Goerzen Cc: Richard Jones , caml-list@inria.fr Subject: Re: [Caml-list] Re: Common IO structure References: <20040428.015800.126758722.yoriyuki@mbg.ocn.ne.jp> <408EEE3E.7050008@socialtools.net> <20040428034415.GB19564@complete.org> <40902265.9040702@socialtools.net> <20040428214442.GE10198@excelhustler.com> <4090E597.1080603@socialtools.net> <20040429122305.GA6688@redhat.com> <40911AF6.7020105@socialtools.net> <20040429153538.GA14089@excelhustler.com> <40912369.6010301@socialtools.net> <20040429204139.GA21608@excelhustler.com> In-Reply-To: <20040429204139.GA21608@excelhustler.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on rabelais.socialtools.net X-Spam-Status: No, hits=-4.9 required=5.0 tests=BAYES_00 autolearn=ham version=2.63 X-Miltered: at nez-perce with ID 40918343.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 python:01 python:01 characters':01 cannasse:01 gerd:01 stolpmann:01 yamagata:01 yoriyuki:01 unicode:01 caml:01 polymorphic:01 bytes:02 thread:02 wrote:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk John Goerzen wrote: > What you have proposed here is exactly what I am proposing and what > Python does. It appears we are somehow in complete agreement about what > should happen. I guess the disagreement is whether it is like Java. I > maintain it is not, since there is a single File object that is used for > everything -- both files themselves and various converters. A basic difference between Python and Java, perhaps, is that Java makes a strict distinction between bytes and characters. In Java, characters are always Unicode characters. Since the most basic kind of stream (what you're calling a 'file object') can't possibly be a converter, its interface can't return characters. Therefore, in Java, at some point you need a different interface, what you could call a 'file object that knows about characters', which Java calls Reader. However, in Caml we can surely do better, as the 'Common IO Structure' thread shows; the basic file/channel/stream type can be polymorphic. Now if only Nicholas Cannasse, Gerd Stolpmann and Yamagata Yoriyuki can only agree on the type parameters... :) Ben ------------------- 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