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.8 required=5.0 tests=AWL,SPF_FAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id DE861BBAF for ; Sun, 5 Apr 2009 22:54:59 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EAEe32ElQRFuwYGdsb2JhbACWGxcLEBKxa4QPBg X-IronPort-AV: E=Sophos;i="4.39,327,1235948400"; d="scan'208";a="37911356" Received: from furbychan.cocan.org ([80.68.91.176]) by mail4-smtp-sop.national.inria.fr with ESMTP; 05 Apr 2009 22:54:59 +0200 Received: from rich by furbychan.cocan.org with local (Exim 4.63) (envelope-from ) id 1LqZMn-0007Zx-CL; Sun, 05 Apr 2009 21:54:57 +0100 Date: Sun, 5 Apr 2009 21:54:57 +0100 To: Daniel =?iso-8859-1?Q?B=FCnzli?= Cc: OCaml List Subject: Re: [Caml-list] Strings Message-ID: <20090405205457.GA22985@annexia.org> References: <200904031256.33357.jon@ffconsultancy.com> <200904031546.14071.jon@ffconsultancy.com> <49D63EE6.2020407@ens-lyon.org> <8697F924-0485-4E00-81DF-9BCF74D872EA@erratique.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8697F924-0485-4E00-81DF-9BCF74D872EA@erratique.ch> User-Agent: Mutt/1.5.13 (2006-08-11) From: Richard Jones X-Spam: no; 0.00; 0200,:01 bunzli:01 camlp:01 syntax:01 2009:98 traded:98 wrote:01 caml-list:01 functions:01 immutable:01 immutable:01 strings:01 strings:01 define:02 essentially:02 On Fri, Apr 03, 2009 at 07:50:48PM +0200, Daniel Bünzli wrote: > Having immutable strings would not rely on the client for correctness > of operation and that's always an advantage. Of course you'll tell me > just use String.copy inside xmlm et voilà, but then you traded > correctness for performance in a case where you could have both with > immutable strings. Could you not just define a new module which is String, but with a restricted interface (removing all the functions that can modify strings)? This is essentially what Batteries does, along with a bit of camlp4 [I think] to provide a rope construction syntax. Rich. -- Richard Jones Red Hat