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 UAA13625; Thu, 20 Jun 2002 20:17:04 +0200 (MET DST) 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 UAA13550 for ; Thu, 20 Jun 2002 20:17:03 +0200 (MET DST) Received: from lcavpc41.epfl.ch (lcavpc41.epfl.ch [128.178.8.81]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g5KIH2H00226 for ; Thu, 20 Jun 2002 20:17:02 +0200 (MET DST) Received: from localhost (henridf@localhost) by lcavpc41.epfl.ch (8.11.6/8.11.6) with ESMTP id g5KICkD09208 for ; Thu, 20 Jun 2002 20:12:46 +0200 X-Authentication-Warning: lcavpc41.epfl.ch: henridf owned process doing -bs Date: Thu, 20 Jun 2002 20:12:46 +0200 (CEST) From: Henri Dubois-Ferriere X-X-Sender: henridf@lcavpc41.epfl.ch Reply-To: Henri DF To: caml-list@inria.fr Subject: [Caml-list] printf arguments Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk In trying to write a wrapper around printf for debug message logging, (a la syslog), I am coming across the following problem: # let myprintf fmt = if (true) then Printf.fprintf stdout fmt;; val myprintf : (unit, out_channel, unit) format -> unit = # Printf.fprintf;; - : out_channel -> ('a, out_channel, unit) format -> 'a = so the myprintf function above does not have the same type as the original fprintf. Note that removing the if clause returns us to the proper type: # let myprintf fmt = Printf.fprintf stdout fmt;; val myprintf : ('a, out_channel, unit) format -> 'a = Any clue why this is so, and how to get around it? Thanks, Henri ------------------- 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