caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe Filliatre <filliatr@lri.fr>
To: "Harrison, John R" <johnh@ichips.intel.com>
Cc: "Martin Jambon" <martin_jambon@emailuser.net>,
	"Caml List" <caml-list@inria.fr>
Subject: RE: [Caml-list] Re: immutable strings (Re: Array 4 MB size limit)
Date: Wed, 31 May 2006 14:53:37 +0200	[thread overview]
Message-ID: <17533.37329.744780.371184@pc9-152.lri.fr> (raw)
In-Reply-To: <196F1D996F92CD46A542EA519DB8CE4703CCA9F0@orsmsx409>


Harrison, John R writes:
 > The point is not that I will mutate a string by accident.

I once discovered a bug in  the Coq proof assistant that was precisely
due  to  a  string (an  identifier)  mutated  by  accident (may  be  I
shouldn't say  it :-) A name  was capitalized in-place  somewhere in a
piece  of code  unrelated with  the Coq  kernel but  of course  it had
consequences all over the system (including the kernel).

So I'm definitely in favor of immutable strings, for the exact reasons
mentioned by John.

But I  think an abstract data type  is not really an  issue, since one
does little pattern-matching on  strings in practice.  And having your
own  abstract data type  for immutable  strings has  other advantages,
such as  the ability  to share equal  strings (using  hash-consing) to
speedup  names comparisons. Even  printing is  not painful  provided a
suitable formatter-based printing function and %a.

-- 
Jean-Christophe Filliâtre (http://www.lri.fr/~filliatr)


  parent reply	other threads:[~2006-05-31 12:53 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-28 23:20 Harrison, John R
2006-05-29  2:36 ` Martin Jambon
2006-05-31 12:53 ` Jean-Christophe Filliatre [this message]
2006-06-05 20:54 ` immutable strings Matti Jokinen
2006-06-07  0:36   ` [Caml-list] " Jacques Garrigue
  -- strict thread matches above, loose matches on Subject: below --
2006-05-29 20:52 [Caml-list] Re: immutable strings (Re: Array 4 MB size limit) Harrison, John R
2006-05-15 18:12 Array 4 MB size limit akalin
2006-05-19  5:57 ` [Caml-list] " Frederick Akalin
2006-05-19 16:28   ` Jozef Kosoru
2006-05-19 21:26     ` Jon Harrop
2006-05-20  1:06       ` Brian Hurt
2006-05-20 21:11         ` immutable strings (Re: [Caml-list] Array 4 MB size limit) 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

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=17533.37329.744780.371184@pc9-152.lri.fr \
    --to=filliatr@lri.fr \
    --cc=caml-list@inria.fr \
    --cc=johnh@ichips.intel.com \
    --cc=martin_jambon@emailuser.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;
as well as URLs for NNTP newsgroup(s).