English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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 <s0567141@sms.ed.ac.uk> wrote:
> Hi all,
>
> My team just noticed that the behavior of Map.fold changed in OCaml
> version 3.08.4.
>
[snip

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

Cheers,
-n8

--
>>>-- Nathaniel Gray -- Caltech Computer Science ------>
>>>-- Mojave Project -- http://mojave.cs.caltech.edu -->