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 TAA06639; Sun, 2 Mar 2003 19:34:48 +0100 (MET) 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 TAA06667 for ; Sun, 2 Mar 2003 19:34:46 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h22IYcT20974; Sun, 2 Mar 2003 19:34:38 +0100 (MET) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA06613; Sun, 2 Mar 2003 19:34:37 +0100 (MET) Date: Sun, 2 Mar 2003 19:34:37 +0100 From: Xavier Leroy To: brogoff@speakeasy.net Cc: Oliver Bandel , "caml-list@inria.fr" Subject: Re: [Caml-list] Strings as arrays or lists... Message-ID: <20030302193437.A6487@pauillac.inria.fr> References: <20030227223155.GA488@first.in-berlin.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: ; from brogoff@speakeasy.net on Thu, Feb 27, 2003 at 05:03:07PM -0800 X-Spam: no; 0.00; caml-list:01 haskell:01 coercions:01 char:01 regexps:01 recursion:01 arrays:01 -bit:01 ocaml:01 module:03 string:03 library:03 horrible:04 platforms:05 integer:06 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > > in Haskell, strings are lists of chars. > > And what a horrible design decision that is! Agreed. Well, it's a great way to multiply the memory requirements for your strings by a factor of 12 (on 32-bit platforms) or 24 (on 64-bit platforms), while at the same time losing constant-time indexing :-) Actually, the list representation of strings is so repugnant that I don't even want to include "explode" and "implode" coercions between string and char list in the standard library. A standard library should steer users away from algorithmically-inefficient code. By not having implode and explode in the library, I hope OCaml programmers will come to the realization that the proper way to operate on strings is either via block operations (the String module, regexps, etc), or by recursion on integer indices. - Xavier Leroy ------------------- 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