Ocaml variadic function problem
I currently have the following code defining the function 'debugf'. I
would like to have the same function return 'unit' instead of 'string',
though. How do I change the definition to make 'debugf "foo"' usable
in a 'unit' context?
let print_debug s = if (!debug) then (
Printf.printf "%s" s;
Pervasives.flush stdout
)
let debugf fmt_etc =
let k result =
(print_debug result; "")
in
Printf.kprintf k fmt_etc
TIA,
-Arthur
|