diff options
Diffstat (limited to 'stdlib/printf.mli')
-rw-r--r-- | stdlib/printf.mli | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/stdlib/printf.mli b/stdlib/printf.mli index 6fcb45ebac..f7dca62d61 100644 --- a/stdlib/printf.mli +++ b/stdlib/printf.mli @@ -82,7 +82,8 @@ val fprintf : out_channel -> ('a, out_channel, unit) format -> 'a - [!]: take no argument and flush the output. - [%]: take no argument and output one [%] character. - [\@]: take no argument and output one [\@] character. - - [,]: take no argument and do nothing. + - [,]: take no argument and output nothing: a no-op delimiter for + conversion specifications. The optional [flags] are: - [-]: left-justify the output (default is right justification). @@ -115,12 +116,6 @@ val printf : ('a, out_channel, unit) format -> 'a val eprintf : ('a, out_channel, unit) format -> 'a (** Same as {!Printf.fprintf}, but output on [stderr]. *) -val ifprintf : 'a -> ('b, 'a, unit) format -> 'b -(** Same as {!Printf.fprintf}, but does not print anything. - Useful to ignore some material when conditionally printing. - @since 3.10.0 -*) - val sprintf : ('a, unit, string) format -> 'a (** Same as {!Printf.fprintf}, but instead of printing on an output channel, return a string containing the result of formatting the arguments. *) @@ -130,6 +125,12 @@ val bprintf : Buffer.t -> ('a, Buffer.t, unit) format -> 'a append the formatted arguments to the given extensible buffer (see module {!Buffer}). *) +val ifprintf : 'a -> ('b, 'a, unit) format -> 'b +(** Same as {!Printf.fprintf}, but does not print anything. + Useful to ignore some material when conditionally printing. + @since 3.10.0 +*) + (** Formatted output functions with continuations. *) val kfprintf : (out_channel -> 'a) -> out_channel -> @@ -139,6 +140,14 @@ val kfprintf : (out_channel -> 'a) -> out_channel -> @since 3.09.0 *) +val ikfprintf : (out_channel -> 'a) -> out_channel -> + ('b, out_channel, unit, 'a) format4 -> 'b +;; +(** Same as [kfprintf] above, but does not print anything. + Useful to ignore some material when conditionally printing. + @since 4.0 +*) + val ksprintf : (string -> 'a) -> ('b, unit, string, 'a) format4 -> 'b;; (** Same as [sprintf] above, but instead of returning the string, passes it to the first argument. |