caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Format and str_formatter
@ 2009-09-11 11:27 Christian Sternagel
  0 siblings, 0 replies; only message in thread
From: Christian Sternagel @ 2009-09-11 11:27 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-09-11 11:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-11 11:27 Format and str_formatter Christian Sternagel

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).