English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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 <dbely@mail.ru>:
> 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.