caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Christian Sternagel <christian.sternagel@uibk.ac.at>
To: caml-list@inria.fr
Subject: Format and str_formatter
Date: Fri, 11 Sep 2009 13:27:52 +0200	[thread overview]
Message-ID: <4AAA3438.5040407@uibk.ac.at> (raw)

Hi there,

Recently I started to use the Format module's support for custom tags 
(in order to print XML). I noticed a somehow strange behavior (at least 
it seems strange to me). What follows is a minimal example:

First enable tag printing via

   # Format.set_tags true;;
   - : unit = ()

Now consider the printing function

   # let f fmt = Format.fprintf fmt "@{<test>test@}";;
   val f : Format.formatter -> unit = <fun>

When used on std_formatter it produces what I expected, namely

   # f Format.std_formatter;;
   <test>test</test>- : unit = ()

On str_formatter however the result is different.

   # f Format.str_formatter;;
   - : unit = ()
   # Format.flush_str_formatter();;
   - : string = "test"

Where have my tags gone? What am I missing here?

thnx for any help

cheers

christian


                 reply	other threads:[~2009-09-11 11:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4AAA3438.5040407@uibk.ac.at \
    --to=christian.sternagel@uibk.ac.at \
    --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;
as well as URLs for NNTP newsgroup(s).