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
[Caml-list] autoconf and caml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-09-06 (11:22)
From: Yaron M. Minsky <yminsky@C...>
Subject: Re: [Caml-list] autoconf and caml

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.


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: