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 WAA12639; Mon, 3 Mar 2003 22:32:34 +0100 (MET) 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 WAA12603 for ; Mon, 3 Mar 2003 22:32:32 +0100 (MET) Received: from mallaury.noc.nerim.net (smtp-102.noc.nerim.net [62.4.17.102]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h23LWVH21616 for ; Mon, 3 Mar 2003 22:32:31 +0100 (MET) Received: from hector.lesours (lesours.starynkevitch.net [80.65.224.217]) by mallaury.noc.nerim.net (Postfix) with ESMTP id A8A2362DE4 for ; Mon, 3 Mar 2003 22:32:28 +0100 (CET) Received: from basile by hector.lesours with local (Exim 3.36 #1 (Debian)) id 18pxXy-0007NY-00 for ; Mon, 03 Mar 2003 22:32:30 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <15971.51694.912617.582567@hector.lesours> Date: Mon, 3 Mar 2003 22:32:30 +0100 To: "caml-list@inria.fr" Subject: Re: [oliver: Re: [Caml-list] Strings as arrays or lists...] In-Reply-To: <20030303210554.GA5245@force.stwing.upenn.edu> References: <20030303182806.GC624@first.in-berlin.de> <20030303210554.GA5245@force.stwing.upenn.edu> X-Mailer: VM 7.08 under Emacs 21.2.2 From: Basile STARYNKEVITCH X-Spam: no; 0.00; basile:01 oliver:01 caml-list:01 lovas:01 wlovas:01 stwing:01 extensional:01 char:01 module's:01 unification:01 generic:01 read-only:01 faiencerie:01 92340:01 reine:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk >>>>> "William" == William Lovas writes: [...] William> You keep skirting around this question by saying that William> what he really wants is extensional polymorphism, but William> overloading is not the only way to get the same syntax William> for strings and arrays. Another way is to have them William> simply *be the same thing*. That is, is there any deep William> reason not to do William> type string = char array William> right up front, and inherit all the Array module's William> functions? We could still keep a String library with all William> string-specific functions in it, but we'd gain a William> unification of many function implementations, and the William> same notation for random access to boot. It could be interesting, but I guess that adding such specifical implementation may seriously increase the compiler complexity and could even explode (or at least seriously increase) the generated code. William> You mentioned that strings are packed -- meaning that William> they're more efficient than generic arrays? But doesn't William> O'Caml already have compiler magic for making float William> arrays fast and efficient? Why not just do the same William> thing for char arrays? I do share the wish but would tend to believe that it is programmer time consuming. For example, grep-ing (case insensitively) for float in the compilers gives a lot of occurrences. Perhaps a long term dream might be to be able to provide specific implementations for different instances of variable types, e.g. different implementations for sets of float versus sets of object instances. Regarding strings I would tend to think that separating mutable strings from read-only strings could be useful, and 16bits or 32bits unicode strings might be desirable. Does any one have ideas on how to implement localisation & internationalisation of applications? -- Basile STARYNKEVITCH http://starynkevitch.net/Basile/ email: basilestarynkevitchnet alias: basiletunesorg 8, rue de la Faïencerie, 92340 Bourg La Reine, France ------------------- 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