From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 BEF2CBB83 for ; Fri, 26 May 2006 01:16:07 +0200 (CEST) Received: from out3.smtp.messagingengine.com (out3.smtp.messagingengine.com [66.111.4.27]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k4PNG7BI030313 for ; Fri, 26 May 2006 01:16:07 +0200 Received: from frontend3.internal (frontend3.internal [10.202.2.152]) by frontend1.messagingengine.com (Postfix) with ESMTP id A48EDD67B5F; Thu, 25 May 2006 19:16:05 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by frontend3.internal (MEProxy); Thu, 25 May 2006 19:16:06 -0400 X-Sasl-enc: jVxAMpPVd9BwGI5g591ugNMpB+vPec9YCjTgexrGlq0a 1148598966 Received: from munge (burnham.ljcrf.edu [192.231.106.2]) by mail.messagingengine.com (Postfix) with ESMTP id 16621557E; Thu, 25 May 2006 19:16:05 -0400 (EDT) Date: Thu, 25 May 2006 16:15:48 -0700 (PDT) From: Martin Jambon X-X-Sender: martin@munge To: Jon Harrop Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Re: immutable strings (Re: Array 4 MB size limit) In-Reply-To: <200605260000.14452.jon@ffconsultancy.com> Message-ID: References: <20060515141230.ajyupn2z28k0484s@horde.akalin.cx> <4475EAC1.4090805@cs.caltech.edu> <200605260000.14452.jon@ffconsultancy.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Miltered: at concorde with ID 44763AB7.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; mutable:01 camlp:01 camlp:01 defines:01 2006:98 wrote:01 wrote:01 caml-list:01 abstract:01 immutable:01 immutable:01 unsafe:01 strings:01 strings:01 jambon:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 On Fri, 26 May 2006, Jon Harrop wrote: > On Thursday 25 May 2006 19:44, Tom wrote: > [immutable strings] >> But why don't you add such a type yourself? > > You would have to make your new type abstract in order to distinguish it from > the build-in mutable string type. Then you lose the ability to do pattern > matching and s.[i]. The former problem can be solved with camlp4 (which would use a "unsafe" function to do the type conversion). The latter can be solved with camlp4 too, or simply by opening a module which defines a String module which provides a "get" function. Martin -- Martin Jambon, PhD http://martin.jambon.free.fr Edit http://wikiomics.org, bioinformatics wiki