Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: 2006-03-01 (05:20)
From: Nathaniel Gray <n8gray@g...>
Subject: Re: [Caml-list] Map.fold behavior changed
On 2/24/06, EEK Cooper <> wrote:
> Hi all,
> My team just noticed that the behavior of Map.fold changed in OCaml
> version 3.08.4.

> 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?

Copy/paste.  Take the implementation you like, copy it, call it MyMap,
and use a sed script to change Map to MyMap in your code.  Quick? 
Yes.  Effective?  Yes.  Elegant?  Not so much.

BTW, cpp won't work because of the lexical differences between ocaml
and C.  OTOH, I think there may be a camlp4 module that implements
cpp-like ifdefs.


>>>-- Nathaniel Gray -- Caltech Computer Science ------>
>>>-- Mojave Project -- -->