From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id DA6A7BC0A for ; Sat, 16 Jun 2007 12:04:09 +0200 (CEST) Received: from outmx020.isp.belgacom.be (outmx020.isp.belgacom.be [195.238.4.201]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l5GA3Omv000823 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 16 Jun 2007 12:03:24 +0200 Received: from outmx020.isp.belgacom.be (localhost [127.0.0.1]) by outmx020.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-OUT-2.22) with ESMTP id l5GA3G0k027134 for ; Sat, 16 Jun 2007 12:03:17 +0200 (envelope-from ) Received: from poincare.swapping.umh.ac.be (86.89-241-81.adsl-dyn.isp.belgacom.be [81.241.89.86]) by outmx020.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-OUT-2.22) with ESMTP id l5GA3978027094; Sat, 16 Jun 2007 12:03:10 +0200 (envelope-from ) Received: from localhost ([127.0.0.1] ident=trch) by poincare.swapping.umh.ac.be with esmtp (Exim 4.67) (envelope-from ) id 1HzV7U-0002C4-4m; Sat, 16 Jun 2007 12:03:00 +0200 Date: Sat, 16 Jun 2007 12:02:59 +0200 (CEST) Message-Id: <20070616.120259.34311907.Christophe.Troestler@umh.ac.be> To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Not really a bug but... From: Christophe TROESTLER In-Reply-To: <46739188.5060605@inria.fr> References: <200706160117.45971.jon@ffconsultancy.com> <46739188.5060605@inria.fr> X-Face: #2fb%mPx>rRL@4ff~TVgZ"<[:,oL"`TUEGK/[8/qb58~C>jR(x4A+v/n)7BgpEtIph_neoLKJBq0JBY9:}8v|j Organization: Universite de Mons-Hainaut (http://math.umh.ac.be/an/) X-Mailer: Mew version 5.2.50 on Emacs 22.0.95 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 4673B56C.002 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; bug:01 christophe:01 troestler:01 christophe:01 troestler:01 ocaml:01 umh:01 frisch:01 frisch:01 semantics:01 literals:01 camlp:01 syntax:01 foobar:01 foobar:01 On Sat, 16 Jun 2007, Alain Frisch 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