Version française
Home     About     Download     Resources     Contact us    
Browse thread
Map.fold behavior changed
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: EEK Cooper <s0567141@s...>
Subject: Map.fold behavior changed
Hi all,

My team just noticed that the behavior of Map.fold changed in OCaml 
version 3.08.4.

I'm concerned that the OCaml team would change the behavior of a 
library function so late in its life. I understand that it was thought 
to be "wrong" <http://caml.inria.fr/mantis/view.php?id=3607>, but 
changing the behavior of an existing function breaks existing apps and 
shouldn't be done lightly. Such changes should, of course, be carefully 
highlighted in a change log as *incompatible* changes, requring updates 
to existing programs--this one was buried under "bug fixes." The old 
behavior was apparently longstanding since 1995 
<http://camlcvs.inria.fr/cgi-bin/cvsweb/ocaml/stdlib/map.ml?annotate=1.15;f=h> 
versus 
<http://camlcvs.inria.fr/cgi-bin/cvsweb/ocaml/stdlib/map.ml?annotate=1.15.4.1;f=h>. If OCaml is meant to be a practical programming language, it should provide consistency for its users from version to 
version.

That said, we're now in the position where we need to compile different 
code depending on the version of OCaml. What's the best way to do 
conditional compilation in OCaml? Should we use cpp and #ifdef, or is 
there a more OCaml-savvy solution?

Thanks in advance,
Ezra