caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Oliver Bandel <oliver@first.in-berlin.de>
To: caml-list@inria.fr
Subject: Re: immutable strings II ([Caml-list] Array 4 MB size limit)
Date: Sat, 20 May 2006 23:29:13 +0200	[thread overview]
Message-ID: <20060520212913.GB2670@first.in-berlin.de> (raw)
In-Reply-To: <Pine.LNX.4.58.0605201104100.20411@shell2.speakeasy.net>

On Sat, May 20, 2006 at 11:32:15AM -0700, brogoff wrote:
> On Fri, 19 May 2006, Brian Hurt wrote:
> > On Fri, 19 May 2006, Jon Harrop wrote:
> >
> > > Agreed. Should OCaml's successor have extensible arrays with 64-bit lengths
> > > and strings as char arrays?
> 
> Strings are random access character collections, so under the hood they might
> be arrays, but I think mutable strings as the default string are a mistake.
> One can imagine other representations for strings, like ropes. I'd like a
> language to allow many different underlying string representations.

I think it would break too much code when changing the string behaviour now.

There should be a keyword "immutable" to make strings immutable.
Your idea would be to make it like records immutable as default
and then the "mutable" word must be used for mutable strings.

This would also work, but then, as mentioned above, this would berak
a lot of aleady existing code.

A compiler switch, that per default uses mutable strings,
so as to provide backwards compatibility, but can be changed
to immutable strings as default.
This default string representation then could be changed with indivdual
used keywords "mutable" and "immutable".

I don't know how much development effort this would be, but it would be a  fine thing.


============++=====================++=======================++
\ default   ||   mutable strings   || immutable  strings    ||
 \-------+  ||   as default        || as default            ||
  keyword \ || (compiler switch)   || (compiler switch)     ||
===========+++=====================++=======================++
    ./.     ||  all strings are    || all strings are       ||
            ||  mutable            || immutable             ||
============++=====================++=======================++
  mutable   || all strings are     || all strings that      ||
            || mutable             || are not declared as   ||
            ||                     || mutable are immutable ||
============++=====================++=======================++
 immutable  || all strings that    || all strings are       ||
            || are not declared as || immutable             ||
            || immutable are       ||                       ||
            || mutable             ||                       ||
============++=====================++=======================++

In short words: The compiler flag would give the default string representation
in use, and the keywords "mutable" and "immutable" used for individual strings
would overwrite that default individally.
And as default for the compiler - for backward compatibility reasons -
would then be used the mutable string representation.

Ciao,
   Oliver


  reply	other threads:[~2006-05-20 21:29 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-15 18:12 Array 4 MB size limit akalin
2006-05-15 18:22 ` [Caml-list] " Nicolas Cannasse
2006-05-15 20:32 ` Damien Doligez
2006-05-15 21:27   ` akalin
2006-05-15 22:51 ` Oliver Bandel
2006-05-16  0:48 ` Brian Hurt
2006-05-16  9:57   ` Damien Doligez
2006-05-16 15:10     ` Markus Mottl
2006-05-16  8:01 ` Xavier Leroy
2006-05-16  8:20   ` Nicolas Cannasse
2006-05-19 17:13     ` Xavier Leroy
2006-05-19  5:57   ` Frederick Akalin
2006-05-19  6:21     ` Oliver Bandel
2006-05-19 12:15     ` Jon Harrop
2006-05-19 19:36       ` akalin
2006-05-19 20:17         ` Oliver Bandel
2006-05-19 16:28     ` Jozef Kosoru
2006-05-19 20:08       ` Oliver Bandel
2006-05-19 21:26       ` Jon Harrop
2006-05-20  1:06         ` Brian Hurt
2006-05-20 18:32           ` brogoff
2006-05-20 21:29             ` Oliver Bandel [this message]
2006-05-22 22:09               ` immutable strings II ([Caml-list] Array 4 MB size limit) Aleksey Nogin
2006-05-20 21:11           ` immutable strings (Re: [Caml-list] " Oliver Bandel
2006-05-25  4:32             ` immutable strings (Re: " Stefan Monnier
2006-05-25  5:56               ` [Caml-list] " Martin Jambon
2006-05-25  7:23                 ` j h woodyatt
2006-05-25 10:22                   ` Jon Harrop
2006-05-25 19:28                   ` Oliver Bandel
2006-05-25 11:14                 ` Brian Hurt
2006-05-25 19:42                   ` Oliver Bandel
2006-05-26  6:51                   ` Alain Frisch
2006-05-25 17:31                 ` Aleksey Nogin
2006-05-25 19:54                   ` Martin Jambon
2006-05-25 11:18               ` Brian Hurt
2006-05-25 17:34                 ` Aleksey Nogin
2006-05-25 18:44                   ` Tom
2006-05-25 23:00                     ` Jon Harrop
2006-05-25 23:15                       ` Martin Jambon
2006-05-20  0:57       ` [Caml-list] Array 4 MB size limit Brian Hurt
2006-05-20  1:17         ` Frederick Akalin
2006-05-20  1:52           ` Brian Hurt
2006-05-20  9:08             ` Jozef Kosoru
2006-05-20 10:12               ` skaller
2006-05-20 11:06                 ` Jozef Kosoru
2006-05-20 12:02                   ` skaller
2006-05-20 21:42                 ` Oliver Bandel
2006-05-21  1:24                   ` skaller
2006-05-21 14:10                     ` Oliver Bandel
     [not found]               ` <Pine.LNX.4.63.0605200847530.10710@localhost.localdomain>
2006-05-20 19:52                 ` Jozef Kosoru
2006-05-20 21:45                   ` Oliver Bandel
2006-05-21  9:26           ` Richard Jones
     [not found]             ` <5CE30707-5DCE-4A22-970E-A49C36F9C901@akalin.cx>
2006-05-22 10:40               ` Richard Jones
2006-05-20 10:51         ` Jozef Kosoru
2006-05-20 14:22           ` Brian Hurt
2006-05-20 18:41             ` j h woodyatt
2006-05-20 19:37               ` Jon Harrop
2006-05-20 20:47             ` Jozef Kosoru
2006-05-26 18:34             ` Ken Rose
2006-05-20 22:07           ` Oliver Bandel
2006-05-20 15:15         ` Don Syme
2006-05-20 22:15           ` Oliver Bandel
2006-05-21  1:25             ` skaller

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=20060520212913.GB2670@first.in-berlin.de \
    --to=oliver@first.in-berlin.de \
    --cc=caml-list@inria.fr \
    /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;
as well as URLs for NNTP newsgroup(s).