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
camlp4 pa_macro
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-09-08 (12:48)
From: David MENTRE <david.mentre@g...>
Subject: Re: [Caml-list] camlp4 pa_macro

2005/9/8, Dmitry Bely <>:
> let debug = ref true
> let log fmt =
>  if !debug then
>    Printf.kprintf print_string fmt
>  else
>    Printf.kprintf ignore fmt
> will in fact give the same result. It does not solve the initial problem -
> completely remove the debugging code from the release binary.

If you use "let debug = true", i.e. remove the reference, the
debugging code is indeed removed for *native* compilation. See this
answer by Xavier Leroy:

BTW, the above old thread is very similar to this one, with different
techniques to have optional debug code.