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 XAA13824; Mon, 3 Mar 2003 23:10:25 +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 XAA13989 for ; Mon, 3 Mar 2003 23:10:23 +0100 (MET) Received: from nef.ens.fr (nef.ens.fr [129.199.96.32]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h23MAMH22704 for ; Mon, 3 Mar 2003 23:10:22 +0100 (MET) Received: from clipper.ens.fr (clipper-gw.ens.fr [129.199.1.22]) by nef.ens.fr (8.12.8/1.01.28121999) with ESMTP id h23MAMqZ014067 for ; Mon, 3 Mar 2003 23:10:22 +0100 (CET) Received: from (george@localhost) by clipper.ens.fr (8.12.3/jb-1.1) Date: Mon, 3 Mar 2003 23:10:22 +0100 From: Nicolas George To: caml-list@inria.fr Subject: [Caml-list] [RANT] String representation (was: Strings as arrays or lists...) Message-ID: <20030303221022.GA24499@clipper.ens.fr> Mail-Followup-To: caml-list@inria.fr References: <20030303182806.GC624@first.in-berlin.de> <20030303210554.GA5245@force.stwing.upenn.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="LQksG6bCIzRHxTLp" Content-Disposition: inline In-Reply-To: <20030303210554.GA5245@force.stwing.upenn.edu> User-Agent: Mutt/1.4 X-Spam: no; 0.00; rant:01 lovas:01 char:01 conceptual:01 bug:01 operands:01 cursors:01 buffer:01 low-level:01 encodings:01 perl's:01 regexps:01 arrays:01 unicode:01 ecrit:01 X-Attachments: type="application/pgp-signature" Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk --LQksG6bCIzRHxTLp Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Le tridi 13 vent=F4se, an CCXI, William Lovas a =E9crit=A0: > type string =3D char array BTW, *this* is the worst conceptual bug in OCaml, directly imported from the C. Strings and arrays are totally different concept. - Strings need fast concatenation and parts extraction, arrays do not need that. - Arrays need fast random access by numeric index, strings do not need that. My dream for a future release of OCaml would be something like that: - string is an abstract type, with fast concatenation (especially when one of the operands is not used anymore; this is like tail-recursion optimisation, but for strings); - there is also a `cursor' type, which is something like a pair (string, index in that string); - there are functions to move cursors forward and backward, take substrings between two cursors, etc.; - while we're at breaking compatibility, strings are fully Unicode capable; - there is a buffer type which is a byte array for low-level operations, and conversion functions between buffers and strings, with several possible encodings; - there is a regular expression module with a syntax as near as perl's as possible (because perl's regexps are great, and we do not want to have to remember yet another regexps variant), which returns cursors for matched substrings. --LQksG6bCIzRHxTLp Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.0 (SunOS) iD8DBQE+Y9LNsGPZlzblTJMRArIdAJ9fegn4JM9G82Rtv4iwgw0Ia7c24ACfVWZe r7E4v2KETijn65nUyF4hSAc= =GZSN -----END PGP SIGNATURE----- --LQksG6bCIzRHxTLp-- ------------------- 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