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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 70F4DBBC4 for ; Fri, 3 Apr 2009 22:41:45 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao4BAMUR1knANzRdkWdsb2JhbACWIwEBAQEJCwoHEQW4ToQPBg X-IronPort-AV: E=Sophos;i="4.38,431,1233529200"; d="scan'208";a="26986611" Received: from mga11.intel.com ([192.55.52.93]) by mail1-smtp-roc.national.inria.fr with ESMTP; 03 Apr 2009 22:41:44 +0200 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 03 Apr 2009 13:37:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.39,321,1235980800"; d="scan'208";a="678611950" Received: from unknown (HELO azsmsx001.amr.corp.intel.com) ([10.2.167.98]) by fmsmga001.fm.intel.com with ESMTP; 03 Apr 2009 13:45:25 -0700 Received: from azsmsx501.amr.corp.intel.com ([10.2.167.99]) by azsmsx001.amr.corp.intel.com ([10.2.167.98]) with mapi; Fri, 3 Apr 2009 13:41:24 -0700 From: "Harrison, John R" To: Paolo Donadeo Cc: OCaml Date: Fri, 3 Apr 2009 13:41:26 -0700 Subject: RE: [Caml-list] Strings Thread-Topic: [Caml-list] Strings Thread-Index: Acm0lPQmXk+uuj4ORPSjzmGchYuE+QAB19sg Message-ID: References: <200904031256.33357.jon@ffconsultancy.com> <200904031546.14071.jon@ffconsultancy.com> <49D63EE6.2020407@ens-lyon.org> <8697F924-0485-4E00-81DF-9BCF74D872EA@erratique.ch> <4b5157c30904031246x1628919ek9bed3e53b672c367@mail.gmail.com> In-Reply-To: <4b5157c30904031246x1628919ek9bed3e53b672c367@mail.gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Spam: no; 0.00; mutable:01 abstraction:01 caml-list:01 functions:01 functions:01 strings:01 strings:01 purely:02 argument:02 argument:02 functional:02 functional:02 string:02 agrees:02 programmer:07 | I can agree with you on this argument, but a question still remains: | why should you ever do things like: | | > # s.[0] <- 'a';; The point is that it might not be your own code that does it, but a function written by someone else to which you innocently pass a string argument. You may think you're writing purely functional code, but unless you've checked all the other functions you're using that accept or return strings, who knows? Even if you aren't a doctrinaire functional programmer, the use of mutable strings as the default weakens the abstraction boundary provided by functions and procedures, and surely everyone agrees on the importance of that. John.