From: Yaron Minsky <yminsky@janestreet.com>
To: Ollie Frolovs <of12343@my.bristol.ac.uk>
Cc: David MENTRE <dmentre@linux-france.org>,
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 16:14:55 -0500 [thread overview]
Message-ID: <CACLX4jSMQYTo0Pw3Y28_k+KKKuZK7JG5h8RxsGvYzSkwj3NirA@mail.gmail.com> (raw)
In-Reply-To: <24B5DA6D-3203-4F62-BB58-99ED8B1C64EF@my.bristol.ac.uk>
It should work for both.
On Thu, Nov 7, 2013 at 3:45 PM, Ollie Frolovs <of12343@my.bristol.ac.uk> wrote:
> 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
>
>
> --
> 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
next prev parent reply other threads:[~2013-11-07 21:14 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
2013-11-07 21:14 ` Yaron Minsky [this message]
-- 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=CACLX4jSMQYTo0Pw3Y28_k+KKKuZK7JG5h8RxsGvYzSkwj3NirA@mail.gmail.com \
--to=yminsky@janestreet.com \
--cc=caml-list@inria.fr \
--cc=dmentre@linux-france.org \
--cc=gabriel.scherer@gmail.com \
--cc=mark@proof-technologies.com \
--cc=of12343@my.bristol.ac.uk \
/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