caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Philippe Wang <lists@philippewang.info>
To: Till Varoquaux <till.varoquaux@gmail.com>
Cc: ocaml ml <caml-list@inria.fr>
Subject: Re: [Caml-list] Printf issues
Date: Sat, 17 Mar 2007 12:56:29 +0100	[thread overview]
Message-ID: <45FBD76D.6050204@philippewang.info> (raw)
In-Reply-To: <9d3ec8300703161134o3866014bie47bf052b20b722@mail.gmail.com>

Till Varoquaux wrote:
> I having typing issues with sprintf:
>
> # Printf.sprintf "%a";;
> - : (unit -> '_a -> string) -> '_a -> string = <fun>
>
> whereas:
>
> # Printf.printf "%a";;
> - : (out_channel -> '_a -> unit) -> '_a -> unit = <fun>
>
> Am I missing something out here? If not why can't sprintf accept the
> same printers as the other?

Probably because it's not meant to be as you want it to be!
Why should sprintf take a function to output something on a channel 
whereas it's used to return a string?

...

Cheers,
 Philippe


  reply	other threads:[~2007-03-17 11:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-16 18:34 Till Varoquaux
2007-03-17 11:56 ` Philippe Wang [this message]
2007-03-17 13:31 ` [Caml-list] " Nicolas Pouillard

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=45FBD76D.6050204@philippewang.info \
    --to=lists@philippewang.info \
    --cc=caml-list@inria.fr \
    --cc=till.varoquaux@gmail.com \
    /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).