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:15)
From: Yann_Régis-Gianas <yann@l...>
Subject: Re: [Caml-list] autoconf and caml
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

	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.

Yann Régis-Gianas.
To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: