caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: David Allsopp <dra-news@metastack.com>
To: Jiten Pathy <jpathy@fssrv.net>
Cc: "caml-list@inria.fr" <caml-list@inria.fr>
Subject: RE: [Caml-list] format strings
Date: Tue, 10 Feb 2015 07:44:05 +0000	[thread overview]
Message-ID: <E51C5B015DBD1348A1D85763337FB6D9E98D7D2D@Remus.metastack.local> (raw)
In-Reply-To: <CAL2Z3DBVtOVU+7NUeEUG-jHvFGi15Uw4VPVAL=1Hz82b1MSGOQ@mail.gmail.com>

Jiten Pathy wrote:
> nvm. make_printf is what I am after.

No it isn't - using internal functions is, to 1 significant figure, never what you're after. Apart from anything, you're instantly forcing your code to be 4.02+

> Some complicated stuff is going on in CamlInternalFormat.

Indeed - 4.02 has a very clever reimplementation of the printf engine.

> On Mon, Feb 9, 2015 at 5:05 PM wrote:
> > Is there a way I can define a function which has the same signature of
> > printf family but is a no-op?
> >
> > f : ('a, 'b, unit) format -> 'a

Printf.ifprintf (you can do similar with Printf.ksprintf and Printf.ikfprintf).

I don't know what lead you to read CamlInternalFormat.mli, but the reference manual (http://caml.inria.fr/pub/docs/manual-ocaml-4.02/libref/Printf.html) is a much better place to start for information on these modules than their source code. 


David

  reply	other threads:[~2015-02-10  7:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-09 11:58 Jiten Pathy
2015-02-09 12:25 ` John F Carr
2015-02-09 16:28   ` Jiten Pathy
2015-02-09 17:32 ` David Allsopp
2015-02-10  1:05   ` Jiten Pathy
2015-02-10  2:47     ` Jiten Pathy
2015-02-10  7:44       ` David Allsopp [this message]
2015-02-10  7:55         ` Jiten Pathy
2015-02-10  8:25           ` David Allsopp
2015-02-10  8:34             ` Jiten Pathy

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=E51C5B015DBD1348A1D85763337FB6D9E98D7D2D@Remus.metastack.local \
    --to=dra-news@metastack.com \
    --cc=caml-list@inria.fr \
    --cc=jpathy@fssrv.net \
    /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;
as well as URLs for NNTP newsgroup(s).