summaryrefslogtreecommitdiffstats
path: root/stdlib/printf.ml
diff options
context:
space:
mode:
authorPierre Weis <Pierre.Weis@inria.fr>2012-04-11 18:01:02 +0000
committerPierre Weis <Pierre.Weis@inria.fr>2012-04-11 18:01:02 +0000
commit1d690696e9a70f3f4e9a78d3ed9fe57c55eaab68 (patch)
tree94ed44ed7e66e6167d1c7197464a843adb27ee12 /stdlib/printf.ml
parentb81519668f7fa3d84f1453dc022a0d4a9b722eb8 (diff)
Introducing ikfprintf.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12343 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'stdlib/printf.ml')
-rw-r--r--stdlib/printf.ml16
1 files changed, 14 insertions, 2 deletions
diff --git a/stdlib/printf.ml b/stdlib/printf.ml
index c55c64d36..567949064 100644
--- a/stdlib/printf.ml
+++ b/stdlib/printf.ml
@@ -638,12 +638,19 @@ let mkprintf to_s get_out outc outs flush k fmt =
kapr kpr fmt
;;
+(**************************************************************
+
+ Defining [fprintf] and various flavors of [fprintf].
+
+ **************************************************************)
+
let kfprintf k oc =
mkprintf false (fun _ -> oc) output_char output_string flush k
;;
-let ifprintf _ = kapr (fun _ -> Obj.magic ignore);;
+let ikfprintf k oc = kapr (fun _ _ -> Obj.magic (k oc));;
let fprintf oc = kfprintf ignore oc;;
+let ifprintf oc = ikfprintf ignore oc;;
let printf fmt = fprintf stdout fmt;;
let eprintf fmt = fprintf stderr fmt;;
@@ -671,7 +678,12 @@ let ksprintf k =
let sprintf fmt = ksprintf (fun s -> s) fmt;;
-(* Obsolete and deprecated. *)
+(**************************************************************
+
+ Deprecated stuff.
+
+ **************************************************************)
+
let kprintf = ksprintf;;
(* For OCaml system internal use only: needed to implement modules [Format]