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 QAA31780; Thu, 15 Jul 2004 16:57:07 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA31656; Thu, 15 Jul 2004 16:57:06 +0200 (MET DST) Received: from fichte.ai.univie.ac.at (fichte.ai.univie.ac.at [131.130.174.156]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i6FEv5SH006508; Thu, 15 Jul 2004 16:57:05 +0200 Received: from fichte.ai.univie.ac.at (markus@localhost [127.0.0.1]) by fichte.ai.univie.ac.at (8.12.3/8.12.3/Debian-6.6) with ESMTP id i6FEv4Du016670; Thu, 15 Jul 2004 16:57:04 +0200 Received: (from markus@localhost) by fichte.ai.univie.ac.at (8.12.3/8.12.3/Debian-6.6) id i6FEv4VV016669; Thu, 15 Jul 2004 16:57:04 +0200 Date: Thu, 15 Jul 2004 16:57:04 +0200 From: Markus Mottl To: "Basile Starynkevitch [local]" Cc: caml-list@inria.fr Subject: Re: [Caml-list] kprintf with user formatters Message-ID: <20040715145704.GA16010@fichte.ai.univie.ac.at> Mail-Followup-To: "Basile Starynkevitch [local]" , caml-list@inria.fr References: <20040630183237.457317c7@mostha> <200407142110.XAA25344@pauillac.inria.fr> <20040715001758.GF26614@fichte.ai.univie.ac.at> <20040715093953.53769963@mostha> <20040715121945.GA11971@fichte.ai.univie.ac.at> <20040715124223.GA28587@bourg.inria.fr> <20040715134530.GC11971@fichte.ai.univie.ac.at> <20040715142214.GB28587@bourg.inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040715142214.GB28587@bourg.inria.fr> User-Agent: Mutt/1.5.6i X-Miltered: at concorde with ID 40F69B41.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 kprintf:01 formatters:01 basile:01 fmt:01 printf:01 kprintf:01 fmt:01 flags:01 resorting:01 preprocessor:02 user-defined:02 mottl:02 mottl:02 computations:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Thu, 15 Jul 2004, Basile Starynkevitch [local] wrote: > let zprintf fmt = Printf.kprintf (fun _ -> ()) fmt > should be ok. This would force string conversion of arguments, which is what I want to avoid, because some of those computations (user-defined ones) would just be too costly. > But I think that the format string should not even be parsed. I've got > no solution (except the one below) to this! It has to be if you want to avoid those computations and return a meaningful value. But the recursive argument-eating function is ok for me, too. > The above hack was written with the same requirements, and provide the > possibility to change log levels (or log flags actually). Ok, I see. This is certainly a way to do it, though it requires the preprocessor. It would still be nice to have an efficient, clean solution without resorting to additional tools. Thanks, anyway! Regards, Markus -- Markus Mottl http://www.oefai.at/~markus markus@oefai.at ------------------- 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