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

« back to all changes in this revision

Viewing changes to ocaml.html/libref/Format.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="Filename.html">
6
8
<link rel="next" href="Gc.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"><link title="Boxes" rel="Section" href="#6_Boxes">
108
111
   <a href="http://caml.inria.fr/resources/doc/guides/format.html">http://caml.inria.fr/resources/doc/guides/format.html</a>.
109
112
<p>
110
113
 
111
 
   Warning: the material output by the following functions is delayed
112
 
   in the pretty-printer queue in order to compute the proper line
113
 
   breaking. Hence, you should not mix calls to the printing functions
114
 
   of the basic I/O system with calls to the functions of this module:
115
 
   this could result in some strange output seemingly unrelated with
116
 
   the evaluation order of printing commands.
117
 
<p>
118
 
 
119
114
   You may consider this module as providing an extension to the
120
115
   <code class="code">printf</code> facility to provide automatic line breaking. The addition of
121
116
   pretty-printing annotations to your regular <code class="code">printf</code> formats gives you
159
154
   In case of interactive use, the system closes all opened boxes and
160
155
   flushes all pending text (as with the <code class="code">print_newline</code> function)
161
156
   after each phrase. Each phrase is therefore executed in the initial
162
 
   state of the pretty-printer.<br>
 
157
   state of the pretty-printer.
 
158
<p>
 
159
 
 
160
   Warning: the material output by the following functions is delayed
 
161
   in the pretty-printer queue in order to compute the proper line
 
162
   breaking. Hence, you should not mix calls to the printing functions
 
163
   of the basic I/O system with calls to the functions of this module:
 
164
   this could result in some strange output seemingly unrelated with
 
165
   the evaluation order of printing commands.<br>
163
166
<hr width="100%">
164
167
<br>
165
168
<a name="6_Boxes"></a>
652
655
     <code class="code">nspaces</code> and <code class="code">offset</code> parameters of the break may be
653
656
     optionally specified with the following syntax:
654
657
     the <code class="code">&lt;</code> character, followed by an integer <code class="code">nspaces</code> value,
655
 
     then an integer offset, and a closing <code class="code">&gt;</code> character.
 
658
     then an integer <code class="code">offset</code>, and a closing <code class="code">&gt;</code> character.
656
659
     If no parameters are provided, the good break defaults to a
657
660
     space.</li>
658
661
<li><code class="code">@?</code>: flush the pretty printer as with <code class="code">print_flush ()</code>.
715
718
   pretty-printer queue would result in unexpected and badly formatted
716
719
   output.<br>
717
720
</div>
718
 
<pre><span class="keyword">val</span> <a name="VALkfprintf"></a>kfprintf : <code class="type">(<a href="Format.html#TYPEformatter">formatter</a> -> 'a) -><br>       <a href="Format.html#TYPEformatter">formatter</a> -> ('b, <a href="Format.html#TYPEformatter">formatter</a>, unit, 'a) format4 -> 'b</code></pre><div class="info">
 
721
<pre><span class="keyword">val</span> <a name="VALkfprintf"></a>kfprintf : <code class="type">(<a href="Format.html#TYPEformatter">formatter</a> -> 'a) -><br>       <a href="Format.html#TYPEformatter">formatter</a> -> ('b, <a href="Format.html#TYPEformatter">formatter</a>, unit, 'a) <a href="Pervasives.html#TYPEformat4">format4</a> -> 'b</code></pre><div class="info">
719
722
Same as <code class="code">fprintf</code> above, but instead of returning immediately,
720
723
   passes the formatter to its first argument at the end of printing.<br>
721
724
</div>
722
 
<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">
 
725
<pre><span class="keyword">val</span> <a name="VALifprintf"></a>ifprintf : <code class="type"><a href="Format.html#TYPEformatter">formatter</a> -> ('a, <a href="Format.html#TYPEformatter">formatter</a>, unit) <a href="Pervasives.html#TYPEformat">format</a> -> 'a</code></pre><div class="info">
 
726
Same as <code class="code">fprintf</code> above, but does not print anything.
 
727
   Useful to ignore some material when conditionally printing.<br>
 
728
</div>
 
729
<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">
723
730
Same as <code class="code">sprintf</code> above, but instead of returning the string,
724
731
   passes it to the first argument.<br>
725
732
</div>
726
 
<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">
 
733
<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">
727
734
A deprecated synonym for <code class="code">ksprintf</code>.<br>
728
735
</div>
729
736
</body></html>
 
 
b'\\ No newline at end of file'