[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Christophe TROESTLER <Christophe.Troestler+ocaml@u...> |
| Subject: | Re: [Caml-list] Not really a bug but... |
On Sat, 16 Jun 2007, Alain Frisch <Alain.Frisch@inria.fr> wrote: > > Jon Harrop wrote: > > Any chance of changing the semantics of string literals so they aren't static? > > A simple Camlp4 syntax extension is enough to turn any literal "foobar" > into String.copy "foobar". (Except it doesn't work because of format > strings.) If it were done automatically, there would be a penalty for > the common case of immutable strings; to avoid it, you'd need to lift > constant literals out of abstractions, which is not very nice. As a side question, any chance of seeing a compiler flag to treat strings in an immutable way (so as to restrict their mutability to some modules only)? ChriS