From: Pierre Weis <Pierre.Weis@inria.fr>
To: ohl@hep.tu-darmstadt.de
Cc: caml-list@inria.fr
Subject: Re: Immutable arrays (modest Feature request)
Date: Wed, 12 Jan 2000 23:06:35 +0100 (MET) [thread overview]
Message-ID: <200001122206.XAA21693@pauillac.inria.fr> (raw)
In-Reply-To: <200001121545.QAA25233@heplix4.ikp.physik.tu-darmstadt.de> from "Thorsten Ohl" at Jan 12, 0 04:45:42 pm
> I've always wondered why O'Caml has no notion of immutable arrays or
> vectors. (Mutable) Arrays are often inconvenient because callers and
> callees must negotiate who is doing the copying. A conservative
> approach will do too many copies.
>
> Semantically, a vector of size n would be a record with
> labels 0,...,n-1 and with O(1) access. One would initialize them from
> a constant (e.g. let v = [{ 42; 137; 1789 }]), a list, an array, or a
> function. Updates would be requested by [{ v with 2 = 2000 }] and most
> of the Array and List library is useful for vectors.
>
> I admit that this is theoretically not very exciting (except for the
> question when the `with' must copy and when not), but rather useful.
>
> Cheers,
> -Thorsten
> --
> Thorsten Ohl, Physics Department, TU Darmstadt -- ohl@hep.tu-darmstadt.de
> http://heplix.ikp.physik.tu-darmstadt.de/~ohl/ [<=== PGP public key here]
It existed in the past in Caml for strings (named ropes) and vectors
(named segments). It has been removed since nobody used them ...
I'm not sure it is worth the additional complexity ...
Pierre Weis
INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://cristal.inria.fr/~weis/
next prev parent reply other threads:[~2000-01-12 22:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-01-12 15:45 Thorsten Ohl
2000-01-12 22:06 ` Pierre Weis [this message]
2000-01-12 22:35 ` Norman Ramsey
[not found] <pfitzen@informatik.uni-tuebingen.de>
2000-01-13 19:45 ` Juergen Pfitzenmaier
2000-01-14 18:09 ` Mark Hayden
2000-01-14 20:29 ` Markus Mottl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200001122206.XAA21693@pauillac.inria.fr \
--to=pierre.weis@inria.fr \
--cc=caml-list@inria.fr \
--cc=ohl@hep.tu-darmstadt.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox