From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id EFA50BC32 for ; Sun, 13 Mar 2005 16:03:05 +0100 (CET) Received: from first.in-berlin.de (dialin-212-144-120-202.arcor-ip.net [212.144.120.202]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j2DF34OF004691 for ; Sun, 13 Mar 2005 16:03:05 +0100 Received: by first.in-berlin.de (Postfix, from userid 501) id C2C23BA17F; Sat, 12 Mar 2005 21:50:11 +0100 (CET) Date: Sat, 12 Mar 2005 21:50:11 +0100 From: Oliver Bandel To: caml-list@yquem.inria.fr Subject: immutable Strings? Message-ID: <20050312205011.GA2244@first.in-berlin.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6i X-Miltered: at nez-perce with ID 42345628.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; oliver:01 bandel:01 oliver:01 in-berlin:01 mutable:01 mutable:01 ocaml:01 cotton:98 torn:98 strings:01 strings:01 immutable:01 immutable:01 data:02 string:03 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.2 X-Spam-Level: Hello, 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. Ciao, Oliver -- "If you desire sanity in this embarassment, stuff not the ear of your mind with cotton" (David Torn)