Skip to content

Commit

Permalink
Merge pull request #628 from vogler/master
Browse files Browse the repository at this point in the history
expose `Format.asprintf` for V>=4.01, fixes #597
  • Loading branch information
gasche committed Jul 23, 2015
2 parents b04e4d4 + cc0b6f9 commit 5dc3f07
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -32,5 +32,6 @@ src/batMarshal.mli
src/batPrintexc.mli
src/batPrintf.ml
src/batPrintf.mli
src/batFormat.mli
src/batSys.mli
src/batBigarray.mli
7 changes: 7 additions & 0 deletions src/batFormat.mli → src/batFormat.mliv
Expand Up @@ -688,6 +688,13 @@ val sprintf : ('a, unit, string) format -> 'a;;
buffer of your own: flushing the formatter and the buffer at the end of
pretty-printing returns the desired string. *)

##V>=4.01##val asprintf : ('a, formatter, unit, string) format4 -> 'a;;
##V>=4.01##(** Same as [printf] above, but instead of printing on a formatter, returns a
##V>=4.01## string containing the result of formatting the arguments. The type of
##V>=4.01## asprintf is general enough to interact nicely with [%a] conversions.
##V>=4.01## @since 4.01.0
##V>=4.01##*)

val ifprintf : formatter -> ('a, formatter, unit) format -> 'a;;
(** Same as [fprintf] above, but does not print anything.
Useful to ignore some material when conditionally printing.
Expand Down

0 comments on commit 5dc3f07

Please sign in to comment.