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
immutable Strings?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-03-13 (15:03)
From: Oliver Bandel <oliver@f...>
Subject: immutable Strings?


for records it is possible to say "mutable" to change a normally
non mutable value into a mutable one.

It would be nice to have the possibility to turn on
immutability fpr strings with a keyword like "immutable"
or so.

So it could be forbidden to modify strings in cases,
where it makes sense; otherwise it must be provided
String.copy at a lot of cases in a program, that
want's to forbid modyfiing the original data.

And disallowing a modification is much stronger/more strict
than only allowing modyfiing a copy.
So, it would be nice to have such a feature in newer versions
of OCaml.


      "If you desire sanity in this embarassment,
        stuff not the ear of your mind with cotton"
                                         (David Torn)