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.2 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 0359FBBC4 for ; Sat, 4 Apr 2009 14:34:04 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AukDAJfw1knCpx6wgWdsb2JhbACWJgEBFiK1dIQPBg X-IronPort-AV: E=Sophos;i="4.39,323,1235948400"; d="scan'208";a="23940999" Received: from smtpmin.univ-orleans.fr (HELO min.univ-orleans.fr) ([194.167.30.176]) by mail2-smtp-roc.national.inria.fr with ESMTP; 04 Apr 2009 14:34:03 +0200 Received: from smtps.univ-orleans.fr (localhost [127.0.0.1]) by min.univ-orleans.fr (Postfix) with ESMTP id A8D1912B577; Sat, 4 Apr 2009 14:34:03 +0200 (CEST) Received: from [192.168.0.12] (ras75-4-82-235-58-110.fbx.proxad.net [82.235.58.110]) by smtps.univ-orleans.fr (Postfix) with ESMTP id 0D16336E60; Sat, 4 Apr 2009 14:34:05 +0200 (CEST) Subject: Re: [Caml-list] Strings From: David Rajchenbach-Teller To: Jon Harrop Cc: caml-list@yquem.inria.fr In-Reply-To: <200904041240.28726.jon@ffconsultancy.com> References: <200904031256.33357.jon@ffconsultancy.com> <200904041111.47211.jon@ffconsultancy.com> <1238843572.6250.49.camel@Blefuscu> <200904041240.28726.jon@ffconsultancy.com> Content-Type: text/plain Date: Sat, 04 Apr 2009 14:34:39 +0200 Message-Id: <1238848479.6250.67.camel@Blefuscu> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; ens-lyon:01 0100,:01 mutable:01 stringset:01 arrays:01 arrays:01 cheers:01 2009:98 2009:98 wrote:01 wrote:01 caml-list:01 strings:01 strings:01 functional:02 On Sat, 2009-04-04 at 12:40 +0100, Jon Harrop wrote: > On Saturday 04 April 2009 12:12:52 David Teller wrote: > > The bad thing is that, whenever you have to return text in an otherwise > > functional program, you need to enter "mutable array of bytes" land. You > > can't just assume that the user isn't going to modify that string, > > because, they can, possibly by accident, and any invariant relying on > > the fact that your strings can't change are going to be broken. In > > particular, any StringSet, any StringMap, etc. > > Sure but that is no different to arrays and an ArraySet, ArrayMap etc. Of course. The thing is that when I'm using arrays, I'm expecting to enter mutable-land. When I'm manipulating text, most of the time, I don't. Cheers, David