caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: skaller <skaller@users.sourceforge.net>
To: Loup Vaillant <loup.vaillant@gmail.com>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Not really a bug but...
Date: Sun, 17 Jun 2007 03:01:21 +1000	[thread overview]
Message-ID: <1182013281.553.13.camel@rosella.wigram> (raw)
In-Reply-To: <6f9f8f4a0706160310m285f0b63r7e2087a31ae46671@mail.gmail.com>

On Sat, 2007-06-16 at 12:10 +0200, Loup Vaillant wrote:
> 2007/6/16, Alain Frisch <Alain.Frisch@inria.fr>:
> > Jon Harrop wrote:
> > > Any chance of changing the semantics of string literals so they aren't static?
> > [...]
> > If it were done automatically, there would be a penalty for
> > the common case of immutable strings; to avoid it, you'd need to lift
> > constant literals out of abstractions, which is not very nice.
> 
> By the way, why Ocaml didn't take the Java path, i.e. making truly
> immutable strings, And provide mutable string buffers as well?

It didn't because it didn't .. :)

Strings are mutable because they can be, without impacting
the run time/garbage collector: Ocam's razor says use
one type when it will do the work of two.

It's unfortunate that in the abstract, Ocaml string are
entirely the worst possible multi-function data type as a result,
since they neither offer the advantages of immutability nor the
advantages of being variable length: mutable fixed length strings
are almost useless .. but not entirely: they're still useful as I/O
buffers.

-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net


  parent reply	other threads:[~2007-06-16 17:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-16  0:17 Jon Harrop
2007-06-16  7:30 ` [Caml-list] " Alain Frisch
2007-06-16 10:02   ` Christophe TROESTLER
2007-06-16 10:10   ` Loup Vaillant
2007-06-16 15:59     ` Richard Jones
2007-06-16 17:01     ` skaller [this message]
2007-06-16 17:03       ` Jon Harrop

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=1182013281.553.13.camel@rosella.wigram \
    --to=skaller@users.sourceforge.net \
    --cc=caml-list@yquem.inria.fr \
    --cc=loup.vaillant@gmail.com \
    /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).