From: Arkady Andrukonis <grazingcows@yahoo.com>
To: Caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Strings
Date: Sat, 18 Apr 2009 05:31:54 -0700 (PDT) [thread overview]
Message-ID: <593018.78609.qm@web63003.mail.re1.yahoo.com> (raw)
In-Reply-To: <1238843572.6250.49.camel@Blefuscu>
Hi,
It appears that Java sidesteps this issue by making string classes final, so that whenever a string object gets modified a new copy of it is generated, giving the appearance of mutable strings, but not really so. It seems Caml is on the right track with immutable strings, we have work-around methods for those occasions where relegating a state change into a confined area is a workable solution. Otherwise the benefit of functional programming would be lost.
kadee
--- On Sat, 4/4/09, David Teller <David.Teller@univ-orleans.fr> wrote:
> From: David Teller <David.Teller@univ-orleans.fr>
> Subject: Re: [Caml-list] Strings
> To: "Jon Harrop" <jon@ffconsultancy.com>
> Cc: caml-list@yquem.inria.fr
> Date: Saturday, April 4, 2009, 7:12 AM
> The bad thing is that, whenever you have to return text in
> an otherwise
> functional program, you need to enter "mutable array
> of bytes" land. You
> can't just assume that the user isn't going to
> modify that string,
> because, they can, possibly by accident, and any invariant
> relying on
> the fact that your strings can't change are going to be
> broken. In
> particular, any StringSet, any StringMap, etc.
>
> Cheers,
> David
>
> On Sat, 2009-04-04 at 11:11 +0100, Jon Harrop wrote:
> > Why? This data structure is a mutable array of bytes
> and should be treated as
> > such.
> >
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list:
> http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
next prev parent reply other threads:[~2009-04-18 12:31 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-03 11:56 Strings Jon Harrop
2009-04-03 12:25 ` [Caml-list] Strings Paolo Donadeo
2009-04-03 14:18 ` Ashish Agarwal
2009-04-03 14:46 ` Jon Harrop
2009-04-03 15:03 ` Daniel Bünzli
2009-04-03 16:52 ` Martin Jambon
2009-04-03 17:50 ` Daniel Bünzli
2009-04-03 19:46 ` Paolo Donadeo
2009-04-03 20:41 ` Harrison, John R
2009-04-04 10:11 ` Jon Harrop
2009-04-04 11:12 ` David Teller
2009-04-04 11:40 ` Jon Harrop
2009-04-04 12:34 ` David Rajchenbach-Teller
2009-04-18 12:31 ` Arkady Andrukonis [this message]
2009-04-04 10:13 ` Jon Harrop
2009-04-03 21:44 ` Goswin von Brederlow
2009-04-04 9:10 ` David Rajchenbach-Teller
2009-04-05 10:06 ` Strings Zheng Li
2009-04-06 9:20 ` Strings David Rajchenbach-Teller
2009-04-06 10:07 ` Strings Goswin von Brederlow
2009-04-06 11:03 ` Strings Zheng Li
2009-04-04 17:11 ` [Caml-list] Strings Kuba Ober
2009-04-04 17:26 ` Jon Harrop
2009-04-05 20:54 ` Richard Jones
2009-04-05 23:40 ` Daniel Bünzli
2009-04-03 18:24 ` Florian Hars
2009-04-03 20:34 ` Arnaud Spiwack
2009-04-04 10:20 ` Jon Harrop
2009-04-04 9:14 ` David Rajchenbach-Teller
2009-04-04 9:26 ` Alp Mestan
2009-04-04 10:55 ` blue storm
2009-04-04 21:51 ` Goswin von Brederlow
2009-04-04 23:35 ` Yaron Minsky
2009-04-05 9:36 ` David Rajchenbach-Teller
2009-04-05 10:08 ` Alp Mestan
2009-04-05 21:41 ` Goswin von Brederlow
2009-04-05 21:40 ` Goswin von Brederlow
2009-04-05 2:55 ` Jon Harrop
2009-04-05 4:22 ` Edgar Friendly
2009-04-05 7:03 ` Goswin von Brederlow
2009-04-05 6:57 ` Goswin von Brederlow
2009-04-05 7:11 ` Jon Harrop
2009-04-04 10:11 ` Jon Harrop
2009-04-04 21:39 ` Goswin von Brederlow
2009-04-05 7:14 ` Romain Beauxis
2009-04-05 9:34 ` David Rajchenbach-Teller
2009-04-05 21:37 ` Goswin von Brederlow
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=593018.78609.qm@web63003.mail.re1.yahoo.com \
--to=grazingcows@yahoo.com \
--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).