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.9 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE 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 E6F0DBBAF for ; Mon, 6 Apr 2009 13:02:16 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhsCAH9+2UnUGyoDlGdsb2JhbACWJgEBAQEJCwgJEQOyaoJIgUcG X-IronPort-AV: E=Sophos;i="4.39,330,1235948400"; d="scan'208";a="24039854" Received: from smtp3-g21.free.fr ([212.27.42.3]) by mail2-smtp-roc.national.inria.fr with ESMTP; 06 Apr 2009 13:02:11 +0200 Received: from smtp3-g21.free.fr (localhost [127.0.0.1]) by smtp3-g21.free.fr (Postfix) with ESMTP id 910828180F0; Mon, 6 Apr 2009 13:02:04 +0200 (CEST) Received: from [192.168.17.1] (ivr94-8-88-162-26-239.fbx.proxad.net [88.162.26.239]) by smtp3-g21.free.fr (Postfix) with ESMTP id 31C8281819D; Mon, 6 Apr 2009 13:02:02 +0200 (CEST) Message-ID: <49D9E185.6060007@users.sourceforge.net> Date: Mon, 06 Apr 2009 13:03:33 +0200 From: Zheng Li User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1b4pre) Gecko/20090405 Lightning/1.0pre Shredder/3.0b3pre MIME-Version: 1.0 To: David Rajchenbach-Teller Cc: Daniel Buenzli , OCaml List Subject: Re: Strings References: <200904031256.33357.jon@ffconsultancy.com> <200904031546.14071.jon@ffconsultancy.com> <49D63EE6.2020407@ens-lyon.org> <8697F924-0485-4E00-81DF-9BCF74D872EA@erratique.ch> <87prftifa3.fsf@frosties.localdomain> <1238836234.6250.6.camel@Blefuscu> <49D8828C.40402@users.sourceforge.net> <1239009623.6058.28.camel@Blefuscu> In-Reply-To: <1239009623.6058.28.camel@Blefuscu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; read-only:01 compiler:01 read-only:01 stdout:01 2009:98 sourceforge:01 wrote:01 readable:01 immutable:01 strings:01 strings:01 argument:02 objective:02 string:02 string:02 On 4/6/2009 11:20 AM, David Rajchenbach-Teller wrote: > Ok, it's actually not *immutable* strings but *read-only* strings. The > objective is to be able to distribute a text and make sure that the > client won't be able to modify it.The original owner can still decide > to enter "mutable-land" if they need it. Fair enough. But then users of the library still have to hard copy a batteries string to ensure it won't change in the future (which is the starting topic of the this thread). > That's by design: [to_string] is the identity operation and it only > applies to strings for which you have both read and write capabilities. > If you wish to do what I believe you have in mind, you need to first > [copy] the string. OK. >> The compiler simply doesn't >> allow me to print out a read-only string, nor does it allow many >> reasonable things like<> etc. > > Er, how can you "not print out a read-only string"? > > And for your [join] problem, well, works for me (as soon as you remember > that it takes as second argument a *list* of readable strings). > > # print stdout (join ro";" [ro"1"; ro"2"; ro"3"]);; > 1;2;3- : unit My mistake. Regards -- Zheng