summaryrefslogtreecommitdiff
path: root/stdlib
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2001-02-13 09:29:39 +0000
committerXavier Leroy <xavier.leroy@inria.fr>2001-02-13 09:29:39 +0000
commit6c79bfce4e207cea8767464635ba9dc8ecb624d7 (patch)
tree16927d950441682435f89f891f1ba86732bb5617 /stdlib
parent2565811d4d4304f2dfc950ad6d6e0eae74465381 (diff)
downloadocaml-6c79bfce4e207cea8767464635ba9dc8ecb624d7.tar.gz
Documenter un peu plus le comportement en cas d'application partielle
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@3416 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/printf.mli11
1 files changed, 9 insertions, 2 deletions
diff --git a/stdlib/printf.mli b/stdlib/printf.mli
index 8f43eba68b..8a57b76304 100644
--- a/stdlib/printf.mli
+++ b/stdlib/printf.mli
@@ -55,8 +55,15 @@ val fprintf: out_channel -> ('a, out_channel, unit) format -> 'a
- Refer to the C library [printf] function for the meaning of
flags and field width specifiers.
- If too few arguments are provided, printing stops just
- before converting the first missing argument. *)
+ 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]. To get the expected behavior, do
+ [List.iter (fun y -> printf "x=%d y=%d " 1 y) [2;3]]. *)
val printf: ('a, out_channel, unit) format -> 'a
(* Same as [fprintf], but output on [stdout]. *)