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 WAA11730; Mon, 3 Mar 2003 22:06:00 +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 WAA11721 for ; Mon, 3 Mar 2003 22:05:58 +0100 (MET) Received: from nexus.stwing.upenn.edu (NEXUS.STWING.UPENN.EDU [165.123.132.61]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h23L5vH20899 for ; Mon, 3 Mar 2003 22:05:57 +0100 (MET) Received: from force.stwing.upenn.edu (daemon@force.stwing.upenn.edu [165.123.132.65]) by nexus.stwing.upenn.edu (8.11.6/8.11.6) with ESMTP id h23L5t514541 (using TLSv1/SSLv3 with cipher EDH-RSA-DES-CBC3-SHA (168 bits) verified NO) for ; Mon, 3 Mar 2003 16:05:56 -0500 (EST) Received: (from wlovas@localhost) by force.stwing.upenn.edu (8.11.6/8.11.6) id h23L5tO06202 for caml-list@inria.fr; Mon, 3 Mar 2003 16:05:55 -0500 (EST) Date: Mon, 3 Mar 2003 16:05:54 -0500 From: William Lovas To: "caml-list@inria.fr" Subject: Re: [oliver: Re: [Caml-list] Strings as arrays or lists...] Message-ID: <20030303210554.GA5245@force.stwing.upenn.edu> Mail-Followup-To: "caml-list@inria.fr" References: <20030303182806.GC624@first.in-berlin.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i X-Spam: no; 0.00; lovas:01 wlovas:01 stwing:01 oliver:01 caml-list:01 brogoff:01 bandel:01 agitate:01 extensional:01 notations:01 char:01 module's:01 unification:01 generic:01 warrant:99 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Mon, Mar 03, 2003 at 12:10:45PM -0800, brogoff@speakeasy.net wrote: > On Mon, 3 Mar 2003, Oliver Bandel wrote: > > What I first have written about the string-stuff, > > was: It's not FP-like, but I also would be happy > > with a syntax, that would allow me, to use Array-functions > > for the Strings. > > That's why I said "Agitate for extensional polyorphism!". You really want a > way to overload similar notations. As you must now know, OCaml has no > overloading. Extensional polymorphism gives you that overloading, on top of > ML, in a way that even people who hate overloading should find fairly > nonthreatening. You keep skirting around this question by saying that what he really wants is extensional polymorphism, but overloading is not the only way to get the same syntax for strings and arrays. Another way is to have them simply *be the same thing*. That is, is there any deep reason not to do type string = char array right up front, and inherit all the Array module's functions? We could still keep a String library with all string-specific functions in it, but we'd gain a unification of many function implementations, and the same notation for random access to boot. You mentioned that strings are packed -- meaning that they're more efficient than generic arrays? But doesn't O'Caml already have compiler magic for making float arrays fast and efficient? Why not just do the same thing for char arrays? You indicated towards the end of your email that you feel that strings and arrays are different enough to warrant different representations, but i'm not convinced yet. What's the good reason for separating these two ideas that are clearly very similar in interface, and probably not too different in implementation? William ------------------- 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