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 UAA11621; Tue, 4 Mar 2003 20:01:58 +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 UAA12351 for ; Tue, 4 Mar 2003 20:01:57 +0100 (MET) Received: from nef.ens.fr (nef.ens.fr [129.199.96.32]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h24J1uT05311 for ; Tue, 4 Mar 2003 20:01:56 +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 h24J1uqZ088179 for ; Tue, 4 Mar 2003 20:01:56 +0100 (CET) Received: from (george@localhost) by clipper.ens.fr (8.12.3/jb-1.1) Date: Tue, 4 Mar 2003 20:01:55 +0100 From: Nicolas George To: caml-list@inria.fr Subject: Re: [Caml-list] [RANT] String representation (was: Strings as arrays or lists...) Message-ID: <20030304190155.GA26932@clipper.ens.fr> Reply-To: caml-list@inria.fr References: <20030303221022.GA24499@clipper.ens.fr> <5.2.0.9.0.20030304080202.03220958@pop.theWorld.com> <20030303221022.GA24499@clipper.ens.fr> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="tKW2IUtsqtDRztdT" Content-Disposition: inline In-Reply-To: <5.2.0.9.0.20030304080202.03220958@pop.theWorld.com> User-Agent: Mutt/1.4 X-Spam: no; 0.00; caml-list:01 rant:01 pons:01 bugged:01 userland:01 compile-time:01 uniqueness:01 buffer:01 cursors:01 arrays:01 fernandez:01 ecrit:01 nicolas:01 syntax:02 olivier:02 X-Attachments: type="application/pgp-signature" Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk --tKW2IUtsqtDRztdT Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Le quartidi 14 vent=F4se, an CCXI, Diego Olivier Fernandez Pons a =E9crit= =A0: > Some of the features you wish are 'not so hard to implement', at least > if you already have 'conceptually bugged low-level' strings : Of course it is possible to do it in "userland". But having it as part of language has several advantages: cleaner syntax, compile-time optimizations, code uniqueness. > You can easily hava a (log n/k + 1) acces where n is the total size of > the string and k is the size of each bucket (if you choose a data > structure with constant buffer size) I really feel that strings do not need fast random access by integer index at all. >> - there is also a `cursor' type, which is something like a pair >> (string, index in that string); > Easy... You can even do better : using a zipper you have constant > acces to the pointed element The cursors I was speaking _must_ provide constant-time access! And (mean-)constant incrementation/decrementation. Le quartidi 14 vent=F4se, an CCXI, David Chase a =E9crit=A0: > sb.append(...); This is really imperative style. --tKW2IUtsqtDRztdT Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.0 (SunOS) iD8DBQE+ZPgisGPZlzblTJMRAhXZAKC6j9nChVKBJhWHX5KcBd4lpQA4MACeI77D 9RNajvUs6AiJlkFBGnXRZcM= =AprK -----END PGP SIGNATURE----- --tKW2IUtsqtDRztdT-- ------------------- 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