From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 2AB641F419 for ; Thu, 8 Sep 2005 14:48:52 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j88CmpVq020875 for ; Thu, 8 Sep 2005 14:48:51 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id OAA05964 for ; Thu, 8 Sep 2005 14:48:51 +0200 (MET DST) Received: from nproxy.gmail.com (nproxy.gmail.com [64.233.182.205]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j88Cmoec003430 for ; Thu, 8 Sep 2005 14:48:50 +0200 Received: by nproxy.gmail.com with SMTP id l37so587136nfc for ; Thu, 08 Sep 2005 05:48:50 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=b+dbxFa4nlsE7SOupG36eJ+eofNxpIaQX5UKI8MmP1oDUViObC7KLYpQC6XWsU5mLCSxSgcZAUVMZlVyNAiftygJbBRdL+DvOJ/5JabPpRkfGnBakSAoxy74TKePf8svdr10Cq4r+a4FIZ7mtlKNJw8h6Ag/8m/nElz0I1VIdaU= Received: by 10.48.248.10 with SMTP id v10mr427832nfh; Thu, 08 Sep 2005 05:48:49 -0700 (PDT) Received: by 10.48.42.9 with HTTP; Thu, 8 Sep 2005 05:48:50 -0700 (PDT) Message-ID: <3d13dcfc05090805485944c24b@mail.gmail.com> Date: Thu, 8 Sep 2005 14:48:50 +0200 From: David MENTRE To: Dmitry Bely Subject: Re: [Caml-list] camlp4 pa_macro Cc: Peter Jolly , caml-list In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <431ED6FB.9010009@jollys.org> X-Miltered: at concorde with ID 43203333.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 43203332.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 fmt:01 printf:01 kprintf:01 fmt:01 printf:01 kprintf:01 debugging:01 binary:01 debugging:01 compilation:01 dmitry:01 thread:02 thread:02 native:02 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_BY_IP autolearn=disabled version=3.0.3 Hello, 2005/9/8, Dmitry Bely : > let debug =3D ref true >=20 > let log fmt =3D > if !debug then > Printf.kprintf print_string fmt > else > Printf.kprintf ignore fmt >=20 > 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 =3D true", i.e. remove the reference, the debugging code is indeed removed for *native* compilation. See this answer by Xavier Leroy: http://groups.google.com/group/fa.caml/browse_frm/thread/e80a6b8cf550a9cc/f= 3bb4fc08274512d?tvc=3D1&q=3Dmentre+leroy+avoid+compiling#f3bb4fc08274512d BTW, the above old thread is very similar to this one, with different techniques to have optional debug code. Yours, d.