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=1.9 required=5.0 tests=DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST 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 EC3B3BBC4 for ; Sat, 18 Apr 2009 14:31:55 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhYCAKdk6UlFk2DWnGdsb2JhbACNJIkWAQEBAQEICwgJEaVfB4ECkCoBBAIBg3oGhWI X-IronPort-AV: E=Sophos;i="4.38,431,1233529200"; d="scan'208";a="27889439" Received: from web63003.mail.re1.yahoo.com ([69.147.96.214]) by mail1-smtp-roc.national.inria.fr with SMTP; 18 Apr 2009 14:31:55 +0200 Received: (qmail 78612 invoked by uid 60001); 18 Apr 2009 12:31:54 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1240057914; bh=tkK0CTfgZWWD43wkT3n7sEsGXe6Ch1GZcvNnNIrucJg=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=LoE3yQ3i3njz094paBZoTmEFwVkTcZelcGkp0CX4lHFTbF4eZrjxeKXkyeJBdVpq7dNvB0sKlMMk7CMImtprLczzOAndFnOaZg+knpG8IWvMCJoezASON6JmOkAmk84S+4GYS0fctDX13NWY0vRhqi2rNPSC4gibV6c01oDPS0U= DomainKey-Signature:a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=Oa4RPq7R26MqlklxIAlh+DCk89FervpmgVu9HBkCtj4DFRGpFdJylJI76Q3yLl5Y8PWngQP6uKN3Bv3rD5SkXnphEtVN0h7MWFT/3jiSzq2KtlN+Sy+z1gPmaTaWaxjJNrCcJk+cb2WntP/ftrpRajk0pk01Ss36mIlyEP8bxXY=; Message-ID: <593018.78609.qm@web63003.mail.re1.yahoo.com> X-YMail-OSG: 6rJlDEgVM1ln8y2CloGKVBdsuKXL6uniGE55EkPAZces_kFAlg8F506OfVVQVhFo5PRx4G7x8j4939HtnT2f2B59JRVXplktk8fJsbq5lkkn7pQBRyRurEu.L9rEtbUrsj9JAPwWBa7weCiWvuPqMqiHNfXYBzm_kw3ctX76aVcwQS6QFtCeydqAHzyN1IJj9tMT6nQTt9MY3Ue4f4HgtnvsOShUqI6ht4ql821x4mcOxREwdhZ7_a2xnOWNkXNT5ZNZRh.KTWVIilAlgtUM9yS5udtzBzq7VICWJhTRLrZa2lWsPYkYOt9x.qTVsa4c351ajou6SjixuIqXRe.2jw-- Received: from [71.125.71.242] by web63003.mail.re1.yahoo.com via HTTP; Sat, 18 Apr 2009 05:31:54 PDT X-Mailer: YahooMailWebService/0.7.289.1 Date: Sat, 18 Apr 2009 05:31:54 -0700 (PDT) From: Arkady Andrukonis Reply-To: grazingcows@yahoo.com Subject: Re: [Caml-list] Strings To: Caml-list@yquem.inria.fr In-Reply-To: <1238843572.6250.49.camel@Blefuscu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam: no; 0.00; mutable:01 work-around:01 univ-orleans:01 univ-orleans:01 mutable:01 stringset:01 cheers:01 0100,:01 beginner's:01 ocaml:01 bug:01 2009:98 beginners:01 wrote:01 wrote:01 Hi, It appears that Java sidesteps this issue by making string classes final, so that whenever a string object gets modified a new copy of it is generated, giving the appearance of mutable strings, but not really so. It seems Caml is on the right track with immutable strings, we have work-around methods for those occasions where relegating a state change into a confined area is a workable solution. Otherwise the benefit of functional programming would be lost. kadee --- On Sat, 4/4/09, David Teller wrote: > From: David Teller > Subject: Re: [Caml-list] Strings > To: "Jon Harrop" > Cc: caml-list@yquem.inria.fr > Date: Saturday, April 4, 2009, 7:12 AM > 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. > > Cheers, > David > > On Sat, 2009-04-04 at 11:11 +0100, Jon Harrop wrote: > > Why? This data structure is a mutable array of bytes > and should be treated as > > such. > > > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: > http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs