English version
Accueil     Ŕ propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis ŕ jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml ŕ l'adresse ocaml.org.

Browse thread
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-04-04 (10:14)
From: Jon Harrop <jon@f...>
Subject: Re: [Caml-list] Strings
On Friday 03 April 2009 16:03:25 Daniel Bünzli wrote:
> Le 3 avr. 09 ŕ 16:46, Jon Harrop a écrit :
> > Just because my OCaml programs were mutating strings and translating
> > that into
> > F# is non-trivial if the string is shared or big. In essence, I've
> > always
> > used OCaml's strings as a more efficient byte array. In fact, the best
> > translation to F# is often to use byte arrays as a replacement for
> > strings.
> So immutable strings are not a "PITA" you are just using them for
> something they should not be taken for (mutable byte arrays).

Except that mutable byte arrays are not treated as strings, e.g. they are 
pretty printed as a garbled pile of bytes. Moreover, immutable strings 
implemented on top of arrays have awful performance characteristics. If 
you're going to use immutable strings then implement it as a rope...

Dr Jon Harrop, Flying Frog Consultancy Ltd.