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.0 required=5.0 tests=none autolearn=disabled version=3.1.3 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 92A01BC69 for ; Tue, 10 Apr 2007 23:35:21 +0200 (CEST) Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l3ALZKkZ027496 for ; Tue, 10 Apr 2007 23:35:21 +0200 Received: from compute2.internal (compute2.internal [10.202.2.42]) by out1.messagingengine.com (Postfix) with ESMTP id C5DC1216E27; Tue, 10 Apr 2007 17:35:36 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Tue, 10 Apr 2007 17:35:18 -0400 X-Sasl-enc: tXJhWzSZaGppJGGyX3ms6H5e2sNhDXzUpRiuew6m3O8a 1176240918 Received: from munge.ljcrf.edu (burnham.ljcrf.edu [192.231.106.2]) by mail.messagingengine.com (Postfix) with ESMTP id 6E9F51DC64; Tue, 10 Apr 2007 17:35:18 -0400 (EDT) Date: Tue, 10 Apr 2007 14:35:11 -0700 (PDT) From: Martin Jambon X-X-Sender: martin@localhost To: David Teller Cc: OCaml Subject: Re: [Caml-list] Read-only arrays ? In-Reply-To: <1176238988.5364.18.camel@Blefuscu> Message-ID: References: <1176238988.5364.18.camel@Blefuscu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Miltered: at concorde with ID 461C0319.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ens-lyon:01 read-only:01 arrays:01 read-only:01 arrays:01 caf:01 ocaml:01 2007,:98 wrote:01 wrote:01 caml-list:01 caml-list:01 strings:01 strings:01 jambon:01 On Tue, 10 Apr 2007, David Teller wrote: > Hi everyone, > > Is there a simple manner of providing read-only/write-only arrays ? I > was hoping that a simple hack using co-variance or contra-variance would > work, but, well, after a few minutes of thought, turns out that it > doesn't. This topic comes up from time to time... My take on this is that read-only arrays or strings are not badly needed. http://caml.inria.fr/pub/ml-archives/caml-list/2006/05/b34caf7bc9a5b651e91706392de65845.en.html I wrote this small interface for R/W/RW strings last year, for fun; I don't use it at all: http://martin.jambon.free.fr/ocaml.html#gstring Martin -- Martin Jambon http://martin.jambon.free.fr