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 36DF9BC48 for ; Mon, 14 Mar 2005 11:40:45 +0100 (CET) Received: from ptb-relay03.plus.net (ptb-relay03.plus.net [212.159.14.214]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j2EAeiNK013266 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 14 Mar 2005 11:40:45 +0100 Received: from [80.229.56.224] (helo=chetara) by ptb-relay03.plus.net with esmtp (Exim) id 1DAn07-0008HK-GS for caml-list@yquem.inria.fr; Mon, 14 Mar 2005 10:40:43 +0000 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] immutable Strings? Date: Mon, 14 Mar 2005 10:41:34 +0000 User-Agent: KMail/1.7.1 References: <20050312205011.GA2244@first.in-berlin.de> <423567E1.1030909@sophia.inria.fr> In-Reply-To: <423567E1.1030909@sophia.inria.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200503141041.34682.jon@ffconsultancy.com> X-Miltered: at nez-perce with ID 42356A2C.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 frog:98 wrote:01 strings:01 immutable:01 immutable:01 readable:02 caml:02 objective:02 string:03 string:03 module:03 pattern:03 modify:05 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: On Monday 14 March 2005 10:30, Pascal Zimmer wrote: > The bad points: > - you cannot use the shortcuts s.[i] and (^) anymore (this gets the code > less readable especially for the first one) > - you have to make a copy when creating an immutable string; if you were > not planning to keep the original string to modify it, this copy is in > fact useless Do you not also lose the ability to do pattern matching and to use all of the existing string-based functionality (e.g. the Str module)? -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. Objective CAML for Scientists http://www.ffconsultancy.com/products/ocaml_for_scientists