<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2006/02/7cb32d4d8e2832b81c79ed65945ec6f0"
  from="EEK Cooper &lt;s0567141@s...&gt;"
  author="EEK Cooper"
  date="2006-02-24T13:29:54"
  subject="Re: [Caml-list] Map.fold behavior changed"
  prev="2006/02/efcb861d4b61cfe98f7d51a795e43854"
  next="2006/02/bdac4aa5b2244cbd120789ea79be308e"
  prev-in-thread="2006/02/08aa1f53f8a7c6e0d96156f8e4d2ca20"
  next-in-thread="2006/02/6cd74be75e657dd668d337c889ce0f93"
  prev-thread="2006/02/03685ae260718d8812c6a6f0bb6dd87d"
  next-thread="2006/02/579a51a1051b15f49ce25ed80aa0704c"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="Map.fold behavior changed">
<msg 
  url="2006/02/023f7ed0bf61833401b5b03efebb8ad0"
  from="EEK Cooper &lt;s0567141@s...&gt;"
  author="EEK Cooper"
  date="2006-02-24T11:22:13"
  subject="Map.fold behavior changed">
<msg 
  url="2006/03/e45f07a7921a3913d9b004ba7c5c7a6f"
  from="Nathaniel Gray &lt;n8gray@g...&gt;"
  author="Nathaniel Gray"
  date="2006-03-01T05:20:22"
  subject="Re: [Caml-list] Map.fold behavior changed">
<msg 
  url="2006/03/18de835f63ea35c07d2aafafc0232ef5"
  from="Nicolas Pouillard &lt;nicolas.pouillard@i...&gt;"
  author="Nicolas Pouillard"
  date="2006-03-01T09:33:05"
  subject="Re: [Caml-list] Map.fold behavior changed">
</msg>
</msg>
<msg 
  url="2006/02/08aa1f53f8a7c6e0d96156f8e4d2ca20"
  from="Jean-Christophe Filliatre &lt;filliatr@l...&gt;"
  author="Jean-Christophe Filliatre"
  date="2006-02-24T11:44:33"
  subject="Re: [Caml-list] Map.fold behavior changed">
<msg 
  url="2006/02/7cb32d4d8e2832b81c79ed65945ec6f0"
  from="EEK Cooper &lt;s0567141@s...&gt;"
  author="EEK Cooper"
  date="2006-02-24T13:29:54"
  subject="Re: [Caml-list] Map.fold behavior changed">
<msg 
  url="2006/02/6cd74be75e657dd668d337c889ce0f93"
  from="Jean-Christophe Filliatre &lt;filliatr@l...&gt;"
  author="Jean-Christophe Filliatre"
  date="2006-02-24T13:44:41"
  subject="Re: [Caml-list] Map.fold behavior changed">
</msg>
<msg 
  url="2006/02/c26c49c6c9ec74064528e5356ed25ba9"
  from="Damien Doligez &lt;damien.doligez@i...&gt;"
  author="Damien Doligez"
  date="2006-02-24T14:12:39"
  subject="Re: [Caml-list] Map.fold behavior changed">
<msg 
  url="2006/02/7debb09fa92be1d26614641750c2962b"
  from="Brian Hurt &lt;bhurt@s...&gt;"
  author="Brian Hurt"
  date="2006-02-24T15:43:39"
  subject="Re: [Caml-list] Map.fold behavior changed">
<msg 
  url="2006/02/a8d5306ea95335fa3871ce04b6289eda"
  from="Jean-Christophe Filliatre &lt;filliatr@l...&gt;"
  author="Jean-Christophe Filliatre"
  date="2006-02-24T16:20:48"
  subject="Re: [Caml-list] Map.fold behavior changed">
</msg>
</msg>
<msg 
  url="2006/02/0d77b7405d73424612a2f87c248a520f"
  from="Joaquin Cuenca Abela &lt;e98cuenc@y...&gt;"
  author="Joaquin Cuenca Abela"
  date="2006-02-24T16:01:16"
  subject="Re: [Caml-list] Map.fold behavior changed">
<msg 
  url="2006/02/514b7eb51d3714ebddea3b570138d626"
  from="Damien Doligez &lt;damien.doligez@i...&gt;"
  author="Damien Doligez"
  date="2006-02-27T12:58:26"
  subject="Re: [Caml-list] Map.fold behavior changed">
<msg 
  url="2006/03/56eb23e5b5df532f3a96deb2636c64ba"
  from="Ezra Cooper &lt;e.e.k.cooper@s...&gt;"
  author="Ezra Cooper"
  date="2006-03-02T13:57:54"
  subject="Re: [Caml-list] Map.fold behavior changed">
<msg 
  url="2006/03/edcb6dfeebf66ece60d6082affa6bdff"
  from="N. Owen Gunden &lt;ogunden@p...&gt;"
  author="N. Owen Gunden"
  date="2006-03-03T15:42:01"
  subject="Re: [Caml-list] Map.fold behavior changed">
<msg 
  url="2006/03/d460e75d3749dde5c0bad5c11de3ab92"
  from="Florian Hars &lt;hars@b...&gt;"
  author="Florian Hars"
  date="2006-03-09T07:15:02"
  subject="Re: [Caml-list] Map.fold behavior changed">
<msg 
  url="2006/03/231da31d9e4d41bb57a11da6da55987b"
  from="Damien Doligez &lt;damien.doligez@i...&gt;"
  author="Damien Doligez"
  date="2006-03-13T16:31:59"
  subject="Re: [Caml-list] Map.fold behavior changed">
<msg 
  url="2006/03/cd3612ec14e188c2bc68a79283052a6c"
  from="Florian Hars &lt;hars@b...&gt;"
  author="Florian Hars"
  date="2006-03-15T07:27:53"
  subject="Re: [Caml-list] Map.fold behavior changed">
<msg 
  url="2006/03/a50eb96dfda9a8898ea4624cadddb7f5"
  from="Jon Harrop &lt;jon@f...&gt;"
  author="Jon Harrop"
  date="2006-03-15T07:35:48"
  subject="Re: [Caml-list] Map.fold behavior changed">
</msg>
<msg 
  url="2006/03/e64da61b7054e651027c4863ef8992b4"
  from="Alain Frisch &lt;Alain.Frisch@i...&gt;"
  author="Alain Frisch"
  date="2006-03-15T07:40:20"
  subject="Re: [Caml-list] Map.fold behavior changed">
<msg 
  url="2006/03/6345d4a53c7192c8f5f1f39dc8e31286"
  from="Florian Hars &lt;hars@b...&gt;"
  author="Florian Hars"
  date="2006-03-15T08:41:20"
  subject="Re: [Caml-list] Map.fold behavior changed">
<msg 
  url="2006/03/0bbb58749645b5dedac1994d4d87ba05"
  from="Christophe Raffalli &lt;raffalli@u...&gt;"
  author="Christophe Raffalli"
  date="2006-03-15T21:18:16"
  subject="Re: [Caml-list] Map.fold behavior changed">
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2006/02/ca3552c47ae89b129e527dca531a1a9f"
  from="Brian Hurt &lt;bhurt@s...&gt;"
  author="Brian Hurt"
  date="2006-02-24T15:31:15"
  subject="Re: [Caml-list] Map.fold behavior changed">
</msg>
</msg>
</thread>

<contents>
I'm glad to hear that others are facing this problem as well. Those of 
you who are: how are you dealing with it? Are you simply requiring your 
users to use a particular version of the compiler? Or switching on 
Sys.ocaml_version?

Quoting Jean-Christophe Filliatre &lt;filliatr@lri.fr&gt;:

&gt; EEK Cooper writes:
&gt;
&gt;  &gt; My team just noticed that the behavior of Map.fold changed in OCaml
&gt;  &gt; version 3.08.4.
&gt;  &gt;
&gt;  &gt; I'm concerned that the OCaml team would change the behavior of a
&gt;  &gt; library function so late in its life. I understand that it was thought
&gt;  &gt; to be "wrong" &lt;http://caml.inria.fr/mantis/view.php?id=3607&gt;, but
&gt;  &gt; changing the behavior of an existing function breaks existing apps and
&gt;  &gt; shouldn't be done lightly.
&gt;
&gt; I must agree  with you since we also  got a similar bug in  one of our
&gt; apps due to this Map.fold _implementation_ change.
&gt;
&gt; However, we must also admit  that we were using an unspecified feature
&gt; of the  standard library. If  I remember correctly,  the documentation
&gt; was saying that  the traversal order was left  _unspecified_.

For the record, I don't think this is true. My copy of map.mli, as part 
of OCaml 3.08.3, says:

     val fold: (key -&gt; 'a -&gt; 'b -&gt; 'b) -&gt; 'a t -&gt; 'b -&gt; 'b
     (** [fold f m a] computes [(f kN dN ... (f k1 d1 a)...)],
        where [k1 ... kN] are the keys of all bindings in [m]
        (in increasing order), and [d1 ... dN] are the associated data. *)

specifying the same ordering as the current version. Also the original 
bug ticket &lt;http://caml.inria.fr/mantis/view.php?id=3607&gt; about the 
issue asserts that it should behave according to the documentation.

Since the behavior was NOT unspecified, it was reasonable to assume 
that the documentation suffered from a simple typo, and to expect the 
behavior not to change. I believe the documentation should have been 
fixed rather than the behavior.

Ezra


</contents>

</message>

