Version française
Home     About     Download     Resources     Contact us    
Browse thread
Strings
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Martin Jambon <martin.jambon@e...>
Subject: Re: [Caml-list] Strings
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).

I love this recurrent discussion!

Here is my firm point of view which hasn't changed over the years and hundreds
of millions documents processed:

- I see absolutely no practical advantage of having an immutable "character
string" type.

- There is nothing to change in OCaml's string type because it is an "array of
bytes", with type char representing single bytes.




Martin

-- 
http://mjambon.com/