caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Oliver Bandel <oliver@first.in-berlin.de>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] immutable Strings?
Date: Tue, 15 Mar 2005 09:40:21 +0100	[thread overview]
Message-ID: <20050315084020.GP321@first.in-berlin.de> (raw)
In-Reply-To: <20050314125728.GA17687@furbychan.cocan.org>

On Mon, Mar 14, 2005 at 12:57:29PM +0000, Richard Jones wrote:
> On Mon, Mar 14, 2005 at 11:30:57AM +0100, Pascal Zimmer wrote:
> > - you cannot use the shortcuts s.[i] and (^) anymore (this gets the code 
> > less readable especially for the first one)
> 
> You can get the s.[i] shortcut by naming your module
> 'ImmString.String' (using a nested module in other words) and using
> 'open ImmString'.  However this has the further problem that you then
> can no longer use mutable strings :-( although perhaps Oliver has
> forsworn use of mutable strings, so this is an acceptable compromise
> for him.

forsworn mutable strings? ???

Mutable strings are ok for many tasks, but sometimes
immutable strings are better.

It's the same like wondering which style of programming is better for a task.
So, OCaml seems to be very open to different programming styles...
...why not to different kinds of strings?


At the time I have done it with String.copy and modyfing the copy.
But as soon as I has some time to look at the suggestions made here,
I may use them in a reimplementation of my module.
Thanks to *.mli this will not affect the user of the module. :)

Ciao,
   Oliver


      parent reply	other threads:[~2005-03-15  8:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-12 20:50 Oliver Bandel
2005-03-14 10:30 ` [Caml-list] " Pascal Zimmer
2005-03-14 10:41   ` Jon Harrop
2005-03-14 11:15     ` Pascal Zimmer
2005-03-14 12:57   ` Richard Jones
2005-03-14 13:01     ` Richard Jones
2005-03-15  2:13       ` Jacques Garrigue
2005-03-15  8:09         ` Oliver Bandel
2005-03-15  8:40     ` Oliver Bandel [this message]

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=20050315084020.GP321@first.in-berlin.de \
    --to=oliver@first.in-berlin.de \
    --cc=caml-list@yquem.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).