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.3 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id CAD64BBC4 for ; Fri, 3 Apr 2009 18:56:53 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiIBAPrc1UlCbwQakGdsb2JhbACWIwEBAQEJCQwHEQS4doQPBg X-IronPort-AV: E=Sophos;i="4.39,320,1235948400"; d="scan'208";a="37816471" Received: from out2.smtp.messagingengine.com ([66.111.4.26]) by mail4-smtp-sop.national.inria.fr with ESMTP; 03 Apr 2009 18:56:19 +0200 Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id E6BFE30EF1C; Fri, 3 Apr 2009 12:56:17 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Fri, 03 Apr 2009 12:56:17 -0400 X-Sasl-enc: og8fDciXpYaA4R35KrbwhO5LyquQPUB4Z/GIvOGG6ftN 1238777777 Received: from [192.168.1.10] (ALyon-157-1-87-173.w90-37.abo.wanadoo.fr [90.37.198.173]) by mail.messagingengine.com (Postfix) with ESMTPSA id 362DB2D38F; Fri, 3 Apr 2009 12:56:17 -0400 (EDT) Message-ID: <49D63EE6.2020407@ens-lyon.org> Date: Fri, 03 Apr 2009 18:52:54 +0200 From: Martin Jambon User-Agent: Thunderbird 2.0.0.17 (X11/20081008) MIME-Version: 1.0 To: =?ISO-8859-1?Q?Daniel_B=FCnzli?= Cc: OCaml List Subject: Re: [Caml-list] Strings References: <200904031256.33357.jon@ffconsultancy.com> <200904031546.14071.jon@ffconsultancy.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Spam: no; 0.00; ens-lyon:01 bunzli:01 ocaml:01 translating:01 non-trivial:01 ocaml's:01 byte:01 byte:01 arrays:01 mutable:01 arrays:01 ocaml's:01 46,:98 char:01 wrote:01 Daniel Bünzli wrote: > > Le 3 avr. 09 à 16:46, Jon Harrop a écrit : > >> Just because my OCaml programs were mutating strings and translating >> that into >> F# is non-trivial if the string is shared or big. In essence, I've always >> used OCaml's strings as a more efficient byte array. In fact, the best >> translation to F# is often to use byte arrays as a replacement for >> strings. > > So immutable strings are not a "PITA" you are just using them for > something they should not be taken for (mutable byte arrays). I love this recurrent discussion! Here is my firm point of view which hasn't changed over the years and hundreds of millions documents processed: - I see absolutely no practical advantage of having an immutable "character string" type. - There is nothing to change in OCaml's string type because it is an "array of bytes", with type char representing single bytes. Martin -- http://mjambon.com/