Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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-05 (20:54)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] Strings
On Fri, Apr 03, 2009 at 07:50:48PM +0200, Daniel Bünzli wrote:
> Having immutable strings would not rely on the client for correctness  
> of operation and that's always an advantage. Of course you'll tell me  
> just use String.copy inside xmlm et voilà, but then you traded  
> correctness for performance in a case where you could have both with  
> immutable strings.

Could you not just define a new module which is String, but with a
restricted interface (removing all the functions that can modify
strings)?  This is essentially what Batteries does, along with a bit
of camlp4 [I think] to provide a rope construction syntax.


Richard Jones
Red Hat