From: "Bünzli Daniel" <daniel.buenzli@erratique.ch>
To: Ralph Douglass <ralph@grayskies.net>
Cc: "Caml List" <caml-list@inria.fr>
Subject: Re: [Caml-list] confusion about mutable strings
Date: Sun, 10 Feb 2008 19:03:56 +0100 [thread overview]
Message-ID: <8BDAF65E-F29B-4F8C-B20E-1E0FDA521609@erratique.ch> (raw)
In-Reply-To: <71767b800802100946o4d465b79xad9b1f9515f7e69f@mail.gmail.com>
Each invocation of foo does not allocate a new string for str, "ffff"
is a constant string allocated once and you are updating this constant.
let str = String.copy "ffff"
will solve your problem.
Best,
Daniel
next prev parent reply other threads:[~2008-02-10 18:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-10 17:46 Ralph Douglass
2008-02-10 18:03 ` Bünzli Daniel [this message]
2008-02-11 0:22 ` [Caml-list] " Ralph Douglass
2008-02-11 10:01 ` Loup Vaillant
2008-02-11 13:46 ` Ralph Douglass
2008-02-12 19:33 ` Ashish Agarwal
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=8BDAF65E-F29B-4F8C-B20E-1E0FDA521609@erratique.ch \
--to=daniel.buenzli@erratique.ch \
--cc=caml-list@inria.fr \
--cc=ralph@grayskies.net \
/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