cultural_sublimation a écrit :
>
>
> Fellow Camels,
>
> How does one handle conditional compilation in OCaml? I want certain
> pieces of debugging code to be included only if a certain environment
> variable is set. This sort of thing is really easy to do in the C
> preprocessor with #ifdefs.
>
> And yes, I know I can use cpp also with OCaml, but I was wondering
> if there was a more "bactrian" way of doing this.
>
> Thanks,
> C.S.
>
You can use camlp4 with pa_macro.
You have then #define, #if construction,
and can use -D ident and -U ident to add or
remove macro definition.
I do not have the magic invocation at hand,
but you'll find.
Hoping this will help.
Salutations
Matt