caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Ollie Frolovs <of12343@my.bristol.ac.uk>
To: David MENTRE <dmentre@linux-france.org>
Cc: Gabriel Scherer <gabriel.scherer@gmail.com>,
	Mark Adams <mark@proof-technologies.com>,
	caml users <caml-list@inria.fr>
Subject: Re: [Caml-list] is there a way for turning strings to "format"s?
Date: Thu, 7 Nov 2013 20:45:37 +0000	[thread overview]
Message-ID: <24B5DA6D-3203-4F62-BB58-99ED8B1C64EF@my.bristol.ac.uk> (raw)
In-Reply-To: <CAC3Lx=YviMcewKrcekS_xVn34uDfRGMrMrpvrxn5gHiJrpNpqQ@mail.gmail.com>

When i first saw this question i had a deja vu moment and as was flicking through “Real World Ocaml” today i found this example in pages 173-174: 

#let fmt = : (‘a, ‘b, ‘c) format = “%i is an integer, %F is a float, \”%s\” is a string\n”;;
val fmt = (int -> float -> string -> ‘c, ‘b, ‘c) format = <abstr>

and then they say you can pass this format string to printf. I don’t know if they mean Jane Street’s Core printf or stock printf. I’m only a beginner myself.

— Ollie

On 7 Nov 2013, at 07:50, David MENTRE <dmentre@linux-france.org> wrote:

> Hello,
> 
> 2013/11/7 Gabriel Scherer <gabriel.scherer@gmail.com>:
>> Do not, ever, use Obj.magic on formatting
>> functions.
> 
> I would say: "Dot not, ever, use Obj.magic (FULL STOP)". ;-)
> 
> BTW, isn't "ksprintf " and related functions used when one wants to
> play with format strings?
> 
> Best regards,
> david
> 
> -- 
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs


  reply	other threads:[~2013-11-07 20:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-06 12:54 "Mark Adams"
2013-11-07  7:33 ` Gabriel Scherer
2013-11-07  7:50   ` David MENTRE
2013-11-07 20:45     ` Ollie Frolovs [this message]
2013-11-07 21:14       ` Yaron Minsky
  -- strict thread matches above, loose matches on Subject: below --
2013-11-06 12:39 Matej Kosik
2013-11-06 12:44 ` Simon Cruanes
2013-11-06 12:50 ` Robert Jakob
2013-11-06 12:57 ` Jeremy Yallop
2013-11-06 13:08   ` Matej Kosik

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=24B5DA6D-3203-4F62-BB58-99ED8B1C64EF@my.bristol.ac.uk \
    --to=of12343@my.bristol.ac.uk \
    --cc=caml-list@inria.fr \
    --cc=dmentre@linux-france.org \
    --cc=gabriel.scherer@gmail.com \
    --cc=mark@proof-technologies.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).