summaryrefslogtreecommitdiffstats
path: root/stdlib
diff options
context:
space:
mode:
authorPierre Weis <Pierre.Weis@inria.fr>2003-04-28 10:21:57 +0000
committerPierre Weis <Pierre.Weis@inria.fr>2003-04-28 10:21:57 +0000
commit1623dc13fc91679ae64a2f2ea074daa256052380 (patch)
treede695d160ac7cd659c64dcbb0e4870ac34a20503 /stdlib
parent47e2d11c7607b07dde2fb5906bf7681a65e63a67 (diff)
Documentation.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5520 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/printf.mli16
1 files changed, 15 insertions, 1 deletions
diff --git a/stdlib/printf.mli b/stdlib/printf.mli
index 23e0ccbac..cf1be6c0a 100644
--- a/stdlib/printf.mli
+++ b/stdlib/printf.mli
@@ -63,8 +63,22 @@ val fprintf : out_channel -> ('a, out_channel, unit, unit) format -> 'a
in the output of [fprintf] at the current point.
- [t]: same as [%a], but takes only one argument (with type
[out_channel -> unit]) and apply it to [outchan].
+ - [$]: variable substitution in strings. Takes two arguments: a
+ function mapping from variable names to string values and a
+ string pattern. After proper substitution, outputs the resulting
+ string pattern. The substitution process looks for variables into
+ the pattern and substitutes each variable name by its value, as
+ obtained by applying the mapping to the variable name. Inside the
+ string pattern, a variable name immediately follows a non-escaped
+ [$] character and is one of the following:
+ - a non empty sequence of alphanumeric or [_] characters,
+ - an arbitrary sequence of characters enclosed by a pair of
+ matching parentheses or curly brackets.
+ An escaped [$] character is a [$] immediately preceded by a backslash
+ character. Into the string pattern, an escaped [$] character is
+ equivalent to any other [$] character that does not introduce a
+ variable name: it stands for a plain [$] character.
- [!]: take no argument and flush the output.
- - [$]: take two arguments.
- [%]: take no argument and output one [%] character.
The optional flags include: