Manpage of Module
Module
Printf
:
sig end
Formatted output functions.
val fprintf : Pervasives.out_channel -> ('a, Pervasives.out_channel, unit) Pervasives.format -> 'a
fprintf outchan format arg1 ... argN formats the arguments arg1 to argN according to the format string format , and outputs the resulting string on the channel outchan
The format is a character string which contains two types of objects: plain characters, which are simply copied to the output channel, and conversion specifications, each of which causes conversion and printing of one argument.
Conversion specifications consist in the % character, followed by optional flags and field widths, followed by one or two conversion character. The conversion characters and their meanings are:.TP "" d , i , n , or N : convert an integer argument to signed decimal.
Warning: if too few arguments are provided, for instance because the printf function is partially applied, the format is immediately printed up to the conversion of the first missing argument; printing will then resume when the missing arguments are provided. For example, List.iter (printf x=%d y=%d 1) [2;3] prints x=1 y=2 3 instead of the expected x=1 y=2 x=1 y=3 List.iter (fun y -> printf x=%d y=%d 1 y) [2;3]
val printf : ('a, Pervasives.out_channel, unit) Pervasives.format -> 'a
Same as Printf.fprintf , but output on stdout
val eprintf : ('a, Pervasives.out_channel, unit) Pervasives.format -> 'a
Same as Printf.fprintf , but output on stderr
val sprintf : ('a, unit, string) Pervasives.format -> 'a
Same as Printf.fprintf , but instead of printing on an output channel, return a string containing the result of formatting the arguments.
val bprintf : Buffer.t -> ('a, Buffer.t, unit) Pervasives.format -> 'a
Same as Printf.fprintf , but instead of printing on an output channel, append the formatted arguments to the given extensible buffer (see module Buffer ).
val kprintf : (string -> 'a) -> ('b, unit, string, 'a) format4 -> 'b
kprintf k format arguments is the same as sprintf format arguments , except that the resulting string is passed as argument to k ; the result of k is then returned as the result of kprintf