From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA13908; Mon, 19 Jul 2004 11:32:37 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 LAA14527; Mon, 19 Jul 2004 11:32:36 +0200 (MET DST) Received: from lri.lri.fr (lri.lri.fr [129.175.15.1]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i6J9WZEV026431; Mon, 19 Jul 2004 11:32:35 +0200 Received: from localhost (localhost [127.0.0.1]) by lri.lri.fr (Postfix) with ESMTP id DAD1019E8A7; Mon, 19 Jul 2004 11:32:05 +0200 (CEST) Received: from lri.lri.fr ([127.0.0.1]) by localhost (lri.lri.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 10957-06; Mon, 19 Jul 2004 11:32:05 +0200 (CEST) Received: from pc8-123 (pc8-123 [129.175.8.123]) by lri.lri.fr (Postfix) with ESMTP id C299B19E700; Mon, 19 Jul 2004 11:32:05 +0200 (CEST) Received: from filliatr by pc8-123 with local (Exim 3.35 #1 (Debian)) id 1BmUVB-0000rr-00; Mon, 19 Jul 2004 11:32:05 +0200 From: Jean-Christophe Filliatre MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16635.38163.336866.609237@gargle.gargle.HOWL> Date: Mon, 19 Jul 2004 11:32:03 +0200 To: Pierre Weis Cc: basile.starynkevitch@inria.fr, caml-list@inria.fr Subject: Re: [Caml-list] kprintf with user formatters In-Reply-To: <200407190917.LAA13543@pauillac.inria.fr> References: <16631.32784.526557.747099@gargle.gargle.HOWL> <200407190917.LAA13543@pauillac.inria.fr> X-Mailer: VM 7.03 under Emacs 20.7.2 Reply-To: Jean-Christophe.Filliatre@lri.fr (Jean-Christophe Filliatre) X-Virus-Scanned: by amavisd-new at lri.fr X-Miltered: at nez-perce with ID 40FB9533.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; filliatre:01 filliatre:01 lri:01 caml-list:01 kprintf:01 formatters:01 pierre:01 weis:01 eprintf:01 ackermann:01 eprintf:01 ackermann:01 wastes:01 printf:01 debug:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Pierre Weis writes: > > This does not solve the problem of evaluating the argument(s) of the logging > application. Consider the example I gave: > > > log 2 (fun () -> > > eprintf "Argument 1 is hard to compute %d\n" (ackermann x x)) > > Your solution would lead to > > if_debug2 eprintf "Argument 1 is hard to compute %d\n" (ackermann x x) > > which wastes is too much computing power when the debug turn out to be > off. This is indeed right, in the general case. However the way I use it, all the computation is always within a function being the first argument of a printf %a, and thus not evaluated (as in the print_tree example I gave). -- Jean-Christophe ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners