From: Henri Dubois-Ferriere <henridf@lcavsun1.epfl.ch>
To: caml-list@inria.fr
Subject: [Caml-list] printf arguments
Date: Thu, 20 Jun 2002 20:12:46 +0200 (CEST) [thread overview]
Message-ID: <Pine.LNX.4.44.0206202008250.8947-100000@lcavpc41.epfl.ch> (raw)
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 = <fun>
# Printf.fprintf;;
- : out_channel -> ('a, out_channel, unit) format -> 'a = <fun>
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 = <fun>
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
next reply other threads:[~2002-06-20 18:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-20 18:12 Henri Dubois-Ferriere [this message]
2002-06-21 12:11 ` Pierre Weis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.44.0206202008250.8947-100000@lcavpc41.epfl.ch \
--to=henridf@lcavsun1.epfl.ch \
--cc=caml-list@inria.fr \
--cc=henri.dubois-ferriere@epfl.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox