From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id NAA01998; Fri, 6 Sep 2002 13:22:43 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id NAA02251 for ; Fri, 6 Sep 2002 13:22:42 +0200 (MET DST) Received: from avocet.mail.pas.earthlink.net (avocet.mail.pas.earthlink.net [207.217.120.50]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g86BMf118214 for ; Fri, 6 Sep 2002 13:22:41 +0200 (MET DST) Received: from user-0ccegbj.cable.mindspring.com ([24.199.65.115] helo=cs.cornell.edu) by avocet.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 17nHC9-00025E-00; Fri, 06 Sep 2002 04:22:37 -0700 Message-ID: <3D788FFC.2020000@cs.cornell.edu> Date: Fri, 06 Sep 2002 07:22:36 -0400 From: "Yaron M. Minsky" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826 X-Accept-Language: en-us, en MIME-Version: 1.0 To: yann@lrde.epita.fr CC: caml-list@inria.fr Subject: Re: [Caml-list] autoconf and caml References: <20020905135720.D5343@pauillac.inria.fr> <20020905161617.A29272@kruuna.Helsinki.FI> <20020906104614.GE607@barcelona.lrde.epita.fr> <3D7889EA.8060406@cs.cornell.edu> <20020906113320.GA16693@barcelona.lrde.epita.fr> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Yann Régis-Gianas wrote: > On Fri, Sep 06, 2002 at 06:56:42AM -0400, Yaron M. Minsky wrote: > >>Yes, but you actually don't really want simple values here, because >>sometimes you want to use those values to do conditional compilation, >>and ocaml values won't help you with that. > > I think conditional compilation cannot be done since modules > are not first class citizens. The only way I see is to introduce > preprocessor comands with camlp4. > > The question is : what kind of conditional compilation do you > want ? If you want something like: > > let foo x = > #ifdef I_LOVE_FOO > "foo" > #else > "bar" > #endif > > It can be replaced by: > > open Config > > let foo x = if i_love_foo then "foo" else "bar" > > You will not pay a runtime cost because "i_love_foo" is a > static value and unused code will be trimmed by ocaml compiler. I personally need real conditional compilation, of the kind that requires camlp4 or some other preprocessor. Sometimes you really need that because different modules (and/or different external C code) is required on different platforms. y ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners