~ubuntu-branches/ubuntu/hardy/ocaml-doc/hardy

« back to all changes in this revision

Viewing changes to ocaml.html/libref/Printf.html

  • Committer: Bazaar Package Importer
  • Author(s): Samuel Mimram
  • Date: 2007-09-08 01:49:22 UTC
  • mfrom: (0.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070908014922-lvihyehz0ndq7suu
Tags: 3.10-1
* New upstream release.
* Removed camlp4 documentation since it is not up-to-date.
* Updated to standards version 3.7.2, no changes needed.
* Updated my email address.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
1
2
<html>
2
3
<head>
3
4
<link rel="stylesheet" href="style.css" type="text/css">
 
5
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
4
6
<link rel="Start" href="index.html">
5
7
<link rel="previous" href="Printexc.html">
6
8
<link rel="next" href="Queue.html">
66
68
<link title="Sys" rel="Chapter" href="Sys.html">
67
69
<link title="Thread" rel="Chapter" href="Thread.html">
68
70
<link title="ThreadUnix" rel="Chapter" href="ThreadUnix.html">
 
71
<link title="Tk" rel="Chapter" href="Tk.html">
69
72
<link title="Unix" rel="Chapter" href="Unix.html">
70
73
<link title="UnixLabels" rel="Chapter" href="UnixLabels.html">
71
74
<link title="Weak" rel="Chapter" href="Weak.html"><title>Printf</title>
131
134
     the format specified by the second letter.</li>
132
135
<li><code class="code"><span class="constructor">Ld</span></code>, <code class="code"><span class="constructor">Li</span></code>, <code class="code"><span class="constructor">Lu</span></code>, <code class="code"><span class="constructor">Lx</span></code>, <code class="code"><span class="constructor">LX</span></code>, <code class="code"><span class="constructor">Lo</span></code>: convert an <code class="code">int64</code> argument to
133
136
     the format specified by the second letter.</li>
134
 
<li><code class="code">a</code>: user-defined printer. Takes two arguments and apply the
 
137
<li><code class="code">a</code>: user-defined printer. Takes two arguments and applies the
135
138
     first one to <code class="code">outchan</code> (the current output channel) and to the
136
139
     second argument. The first argument must therefore have type
137
140
     <code class="code">out_channel <span class="keywordsign">-&gt;</span> <span class="keywordsign">'</span>b <span class="keywordsign">-&gt;</span> unit</code> and the second <code class="code"><span class="keywordsign">'</span>b</code>.
141
144
     <code class="code">out_channel <span class="keywordsign">-&gt;</span> unit</code>) and apply it to <code class="code">outchan</code>.</li>
142
145
<li><code class="code">{ fmt %}</code>: convert a format string argument. The argument must
143
146
     have the same type as the internal format string <code class="code">fmt</code>.</li>
144
 
<li><code class="code">\( fmt %\)</code>: format string substitution. Takes a format string
 
147
<li><code class="code">( fmt %)</code>: format string substitution. Takes a format string
145
148
     argument and substitutes it to the internal format string <code class="code">fmt</code>
146
149
     to print following arguments. The argument must have the same
147
150
     type as <code class="code">fmt</code>.</li>
187
190
<pre><span class="keyword">val</span> <a name="VALeprintf"></a>eprintf : <code class="type">('a, <a href="Pervasives.html#TYPEout_channel">out_channel</a>, unit) <a href="Pervasives.html#TYPEformat">format</a> -> 'a</code></pre><div class="info">
188
191
Same as <a href="Printf.html#VALfprintf"><code class="code"><span class="constructor">Printf</span>.fprintf</code></a>, but output on <code class="code">stderr</code>.<br>
189
192
</div>
 
193
<pre><span class="keyword">val</span> <a name="VALifprintf"></a>ifprintf : <code class="type">'a -> ('b, 'a, unit) <a href="Pervasives.html#TYPEformat">format</a> -> 'b</code></pre><div class="info">
 
194
Same as <a href="Printf.html#VALfprintf"><code class="code"><span class="constructor">Printf</span>.fprintf</code></a>, but does not print anything.
 
195
    Useful to ignore some material when conditionally printing.<br>
 
196
</div>
190
197
<pre><span class="keyword">val</span> <a name="VALsprintf"></a>sprintf : <code class="type">('a, unit, string) <a href="Pervasives.html#TYPEformat">format</a> -> 'a</code></pre><div class="info">
191
198
Same as <a href="Printf.html#VALfprintf"><code class="code"><span class="constructor">Printf</span>.fprintf</code></a>, but instead of printing on an output channel,
192
 
   return a string containing the result of formatting
193
 
   the arguments.<br>
 
199
   return a string containing the result of formatting the arguments.<br>
194
200
</div>
195
201
<pre><span class="keyword">val</span> <a name="VALbprintf"></a>bprintf : <code class="type"><a href="Buffer.html#TYPEt">Buffer.t</a> -> ('a, <a href="Buffer.html#TYPEt">Buffer.t</a>, unit) <a href="Pervasives.html#TYPEformat">format</a> -> 'a</code></pre><div class="info">
196
202
Same as <a href="Printf.html#VALfprintf"><code class="code"><span class="constructor">Printf</span>.fprintf</code></a>, but instead of printing on an output channel,
197
203
   append the formatted arguments to the given extensible buffer
198
204
   (see module <a href="Buffer.html"><code class="code"><span class="constructor">Buffer</span></code></a>).<br>
199
205
</div>
200
 
<pre><span class="keyword">val</span> <a name="VALkfprintf"></a>kfprintf : <code class="type">(<a href="Pervasives.html#TYPEout_channel">out_channel</a> -> 'a) -><br>       <a href="Pervasives.html#TYPEout_channel">out_channel</a> -><br>       ('b, <a href="Pervasives.html#TYPEout_channel">out_channel</a>, unit, 'a) format4 -> 'b</code></pre><div class="info">
 
206
<pre><span class="keyword">val</span> <a name="VALkfprintf"></a>kfprintf : <code class="type">(<a href="Pervasives.html#TYPEout_channel">out_channel</a> -> 'a) -><br>       <a href="Pervasives.html#TYPEout_channel">out_channel</a> -><br>       ('b, <a href="Pervasives.html#TYPEout_channel">out_channel</a>, unit, 'a) <a href="Pervasives.html#TYPEformat4">format4</a> -> 'b</code></pre><div class="info">
 
207
Formatted output functions with continuations.
 
208
<p>
201
209
Same as <code class="code">fprintf</code>, but instead of returning immediately,
202
210
   passes the out channel to its first argument at the end of printing.<br>
203
211
</div>
204
 
<pre><span class="keyword">val</span> <a name="VALksprintf"></a>ksprintf : <code class="type">(string -> 'a) -> ('b, unit, string, 'a) format4 -> 'b</code></pre><div class="info">
 
212
<pre><span class="keyword">val</span> <a name="VALksprintf"></a>ksprintf : <code class="type">(string -> 'a) -> ('b, unit, string, 'a) <a href="Pervasives.html#TYPEformat4">format4</a> -> 'b</code></pre><div class="info">
205
213
Same as <code class="code">sprintf</code> above, but instead of returning the string,
206
214
   passes it to the first argument.<br>
207
215
</div>
208
 
<pre><span class="keyword">val</span> <a name="VALkprintf"></a>kprintf : <code class="type">(string -> 'a) -> ('b, unit, string, 'a) format4 -> 'b</code></pre><div class="info">
 
216
<pre><span class="keyword">val</span> <a name="VALkbprintf"></a>kbprintf : <code class="type">(<a href="Buffer.html#TYPEt">Buffer.t</a> -> 'a) -><br>       <a href="Buffer.html#TYPEt">Buffer.t</a> -> ('b, <a href="Buffer.html#TYPEt">Buffer.t</a>, unit, 'a) <a href="Pervasives.html#TYPEformat4">format4</a> -> 'b</code></pre><div class="info">
 
217
Same as <code class="code">bprintf</code>, but instead of returning immediately,
 
218
   passes the buffer to its first argument at the end of printing.<br>
 
219
</div>
 
220
<pre><span class="keyword">val</span> <a name="VALkprintf"></a>kprintf : <code class="type">(string -> 'a) -> ('b, unit, string, 'a) <a href="Pervasives.html#TYPEformat4">format4</a> -> 'b</code></pre><div class="info">
209
221
A deprecated synonym for <code class="code">ksprintf</code>.<br>
210
222
</div>
211
223
</body></html>
 
 
b'\\ No newline at end of file'