From: Jeremie Dimino <jdimino@janestreet.com>
To: Matej Kosik <5764c029b688c1c0d24a2e97cd764f@gmail.com>
Cc: "caml-list@inria.fr" <caml-list@inria.fr>
Subject: Re: [Caml-list] [batteries] ... how to create (format) directives that do not take any arguments?
Date: Wed, 27 Nov 2013 11:54:42 +0000 [thread overview]
Message-ID: <CANhEzE64KoM-NquvD6rKmY1sP9+BKgLhg2HoJBnzOd4oEM3rkg@mail.gmail.com> (raw)
In-Reply-To: <529370C0.9020801@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 553 bytes --]
On Mon, Nov 25, 2013 at 3:46 PM, Matej Kosik <
5764c029b688c1c0d24a2e97cd764f@gmail.com> wrote:
> I would like to define custom directives, that would enable me to write
> code like e.g. this:
>
> Print.printf "regular %bold_on bold %bold_off regular %italic_on italic
> %italic_off";
[...]
> Can somebody give me some advice how to create simple "parameterless
> format directives" (like those above)?
>
IIRC, this should work:
let printer_bold_on k = k (fun oc -> output_string oc "blah")
to define the format directive %bold_on.
--
Jeremie
[-- Attachment #2: Type: text/html, Size: 1173 bytes --]
next prev parent reply other threads:[~2013-11-27 11:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-25 15:46 Matej Kosik
2013-11-25 16:27 ` Gabriel Scherer
2013-11-27 11:37 ` Matej Kosik
2013-11-28 6:30 ` [Caml-list] [batteries] ... how to create (format) directives oleg
2013-11-29 9:32 ` Matej Kosik
2013-11-30 3:15 ` oleg
2013-11-27 11:54 ` Jeremie Dimino [this message]
2013-11-27 12:52 ` [Caml-list] [batteries] ... how to create (format) directives that do not take any arguments? Matej Kosik
2013-11-27 13:00 ` Jeremie Dimino
2013-11-29 9:32 ` 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=CANhEzE64KoM-NquvD6rKmY1sP9+BKgLhg2HoJBnzOd4oEM3rkg@mail.gmail.com \
--to=jdimino@janestreet.com \
--cc=5764c029b688c1c0d24a2e97cd764f@gmail.com \
--cc=caml-list@inria.fr \
/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