From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 1782DBBBC for ; Wed, 1 Mar 2006 06:20:22 +0100 (CET) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.201]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k215KKAw017529 for ; Wed, 1 Mar 2006 06:20:21 +0100 Received: by zproxy.gmail.com with SMTP id x3so52815nzd for ; Tue, 28 Feb 2006 21:20:20 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=umYErplRrxN/pJF7kmJWpAbMRmUVKMIHOLI+2cLYQ0faD/kG4FVOxsKvWTVE4DfkG6/XL9MhQ9/1HYDODLeqw9uVQ8yjtY+7cv+fBF5d9WmhAjLjRo2WccXoNBhJv0a40JE776gQAszO+a65pXvn1aeRbw6iF8vv0KSPzSdAizs= Received: by 10.36.227.73 with SMTP id z73mr4444795nzg; Tue, 28 Feb 2006 21:20:20 -0800 (PST) Received: by 10.36.13.11 with HTTP; Tue, 28 Feb 2006 21:20:20 -0800 (PST) Message-ID: Date: Tue, 28 Feb 2006 21:20:20 -0800 From: "Nathaniel Gray" To: "EEK Cooper" Subject: Re: [Caml-list] Map.fold behavior changed Cc: caml-list@yquem.inria.fr In-Reply-To: <20060224112209.51szurk2dc00oggg@www.sms.ed.ac.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <20060224112209.51szurk2dc00oggg@www.sms.ed.ac.uk> X-Miltered: at nez-perce with ID 44052F14.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 ocaml:01 compilation:01 cpp:01 ifdef:01 sed:01 cpp:01 camlp:01 implements:01 cheers:01 wrote:01 lexical:01 compile:01 caltech:02 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_BY_IP autolearn=disabled version=3.0.3 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. > [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?=20 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 -->