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
confusion about mutable strings
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-02-10 (18:03)
From: Bünzli_Daniel <daniel.buenzli@e...>
Subject: Re: [Caml-list] confusion about mutable strings
Each invocation of foo does not allocate a new string for str, "ffff"  
is a constant  string allocated once and you are updating this constant.

let str = String.copy "ffff"

will solve your problem.