1
0
Fork 0
cl-sites/ecl.common-lisp.dev/static/manual/Printer.html
2024-12-24 19:15:49 +01:00

228 lines
15 KiB
HTML

<!DOCTYPE html>
<html>
<!-- Created by GNU Texinfo 7.0.3, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Printer (ECL Manual)</title>
<meta name="description" content="Printer (ECL Manual)">
<meta name="keywords" content="Printer (ECL Manual)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link href="index.html" rel="start" title="Top">
<link href="Indexes.html" rel="index" title="Indexes">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Standards.html" rel="up" title="Standards">
<link href="Reader.html" rel="next" title="Reader">
<link href="Streams.html#Streams" rel="prev" title="Streams">
<style type="text/css">
<!--
/* colors */
span.r {font-family: initial; font-weight: normal; font-style: normal}
@media (prefers-color-scheme: dark) {
/* dark theme */
html { color: seashell;
background: #1A1A1A; }
body { background: #1A1A1A; }
th { border-bottom: 2px solid lightgray; }
h1, h2, h3, h4, h5 { background-image: linear-gradient(to left, #202020, #3A3A3A); }
code, var, code a { color: darkorange;
background: #2A2A2A; }
a { color: seashell; }
pre { background: #2A2A2A;
color: seashell;
/* mark longer code block with stripe on the left */
border-left: 5px solid darkorange;
padding-left: 10px; }
pre.screen { background: #2A2A2A;
border: 1px solid lightgray; }
pre.programlisting { background: #2A2A2A;
border-left: 1px solid lightgray;
border-top: 1px solid lightgray; }
/* we need a light background in order for the images to be readable */
img { background: white }
}
@media (prefers-color-scheme: light) {
/* light theme */
html { background: white }
body { background: white }
th { border-bottom: 2px solid gray; }
h1, h2, h3, h4, h5 { background: lightgray; }
code, var, code a { color: darkred;
background: whitesmoke; }
a { color: #000; }
pre { background: whitesmoke;
color: black;
/* mark longer code block with stripe on the left */
border-left: 5px solid darkred;
padding-left: 10px; }
pre.screen { background: #EEE;
border: 1px solid black; }
pre.programlisting { background: #EEEEEE;
border-left: 1px solid black;
border-top: 1px solid black; }
}
body {
margin: 1em 125px 0 10%;
line-height: 1.5em;
padding: 0 2em 1em 2em;
font: 13px Verdana,Arial, sans-serif
}
ul, dd, dl, dt { margin-top: 0; margin-bottom: 0; }
p, code, td, dl, dt {
line-height: 1.5em;
}
table {
font: inherit;
border-collapse: collapse;
}
th, td {
vertical-align: top;
}
h1, h2, h3 { padding-left: 15px; }
h4, h5 { padding-left: 5px; }
code, pre {
font-size: 1em;
font-family: monospace;
}
var {
font-size: 1em;
}
/* links inside code appear the same as the code itself */
code a {
font-weight: normal;
text-decoration: none;
}
/* but get an underline when hovering */
code a:hover {
text-decoration: underline;
}
/* ordinary links appear in bold */
a { font-weight: bold; }
pre.verbatim {
margin: 0 0 0 0;
}
pre {
overflow: auto;
}
pre.screen {
font-weight: bold;
padding: 0.5em;
}
pre.programlisting {
padding: 0.5em;
}
div p { padding: 0 2em }
li p { padding: 0; margin: 0 }
hr { display: none; }
div.funcsynopsis p {
text-indent: -2em;
}
div.variablelist {
padding: 0 2em;
}
.type, .funcsynopsis, .symbol {
font-family: monospace;
}
.type, .symbol, .replaceable {
white-space: nowrap;
}
-->
</style>
</head>
<body lang="en">
<div class="section-level-extent" id="Printer">
<div class="nav-panel">
<p>
Next: <a href="Reader.html" accesskey="n" rel="next">Reader</a>, Previous: <a href="Streams.html#Streams" accesskey="p" rel="prev">Streams</a>, Up: <a href="Standards.html" accesskey="u" rel="up">Standards</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Indexes.html" title="Index" rel="index">Index</a>]</p>
</div>
<h3 class="section" id="Printer-1">2.20 Printer</h3>
<p>In all situations where the rules are well specified, ECL prints objects according to ANSI [see <a class="pxref" href="Bibliography.html">ANSI</a>]. The specification leaves however a number of cases as implementation dependent behavior. The output of ECL in those cases is summarized in <a class="ref" href="Printer.html#tab_003aimpl_002dspec_002dprint_002drep">Table 2.11</a>. Except for the types <code class="code">character</code> and <code class="code">random-state</code>, most of those examples regard non-standard written forms <code class="code">#&lt;...&gt;</code> cannot be read back using <code class="code">read</code>. These printed representations are just informative and should not be used to reconstruct or compare objects.
</p>
<div class="float" id="tab_003aimpl_002dspec_002dprint_002drep">
<table class="multitable">
<thead><tr><th width="28%">Lisp type</th><th width="35%">Format</th><th width="37%">Remarks</th></tr></thead>
<tbody><tr><td width="28%"><code class="code">package</code></td><td width="35%"><code class="code">#&lt;package <var class="var">name</var>&gt;</code></td><td width="37%"></td></tr>
<tr><td width="28%"><code class="code">random-state</code></td><td width="35%"><code class="code">#&lt;random-state <var class="var">array</var>&gt;</code></td><td width="37%"></td></tr>
<tr><td width="28%"><code class="code">bitvector</code></td><td width="35%"><code class="code">#&lt;bit-vector <var class="var"><var class="var">unique-id</var></var>&gt;</code></td><td width="37%">Only when <code class="code">*print-array*</code> is false.</td></tr>
<tr><td width="28%"><code class="code">vector</code></td><td width="35%"><code class="code">#&lt;vector <var class="var">unique-id</var>&gt;</code></td><td width="37%">Only when <code class="code">*print-array*</code> is false.</td></tr>
<tr><td width="28%"><code class="code">array</code></td><td width="35%"><code class="code">#&lt;array <var class="var">unique-id</var>&gt;</code></td><td width="37%">Only when <code class="code">*print-array*</code> is false.</td></tr>
<tr><td width="28%"><code class="code">hash-table</code></td><td width="35%"><code class="code">#&lt;hash-table <var class="var">unique-id</var>&gt;</code></td><td width="37%"></td></tr>
<tr><td width="28%"><code class="code">readtable</code></td><td width="35%"><code class="code">#&lt;readtable <var class="var">unique-id</var>&gt;</code></td><td width="37%"></td></tr>
<tr><td width="28%"><code class="code">interpreted function</code></td><td width="35%"><code class="code">#&lt;bytecompiled-function <var class="var">name-or-id</var>&gt;</code></td><td width="37%">Name is a symbol.</td></tr>
<tr><td width="28%"><code class="code">machine compiled function</code></td><td width="35%"><code class="code">#&lt;compiled-function <var class="var">name</var>&gt;</code></td><td width="37%">Name is a symbol.</td></tr>
<tr><td width="28%"><code class="code">input-stream</code></td><td width="35%"><code class="code">#&lt;input stream &quot;<var class="var">filename</var>&quot;&gt;</code></td><td width="37%">An stream that reads from <var class="var">filename</var>.</td></tr>
<tr><td width="28%"><code class="code">output-stream</code></td><td width="35%"><code class="code">#&lt;output stream &quot;<var class="var">filename</var>&quot;&gt;</code></td><td width="37%">An stream that writes to <var class="var">filename</var>.</td></tr>
<tr><td width="28%"><code class="code">probe-stream</code></td><td width="35%"><code class="code">#&lt;probe stream &quot;<var class="var">filename</var>&quot;&gt;</code></td><td width="37%"></td></tr>
<tr><td width="28%"><code class="code">string-input-stream</code></td><td width="35%"><code class="code">#&lt;string-input stream from &quot;<var class="var">string-piece</var>&quot;&gt;</code></td><td width="37%">The string is the text left to be read.</td></tr>
<tr><td width="28%"><code class="code">string-output-stream</code></td><td width="35%"><code class="code">#&lt;string-output stream <var class="var">unique-id</var>&gt;</code></td><td width="37%"></td></tr>
<tr><td width="28%"><code class="code">two-way-stream</code></td><td width="35%"><code class="code">#&lt;two-way stream <var class="var">unique-id</var>&gt;</code></td><td width="37%"></td></tr>
<tr><td width="28%"><code class="code">echo-stream</code></td><td width="35%"><code class="code">#&lt;echo stream <var class="var">unique-id</var>&gt;</code></td><td width="37%"></td></tr>
<tr><td width="28%"><code class="code">synonym-stream</code></td><td width="35%"><code class="code">#&lt;synonym stream to <var class="var">symbol</var>&gt;</code></td><td width="37%"></td></tr>
<tr><td width="28%"><code class="code">broadcast-stream</code></td><td width="35%"><code class="code">#&lt;broadcast stream <var class="var">unique-id</var>&gt;</code></td><td width="37%"></td></tr>
<tr><td width="28%"><code class="code">concatenated-stream</code></td><td width="35%"><code class="code">#&lt;concatenated stream <var class="var">unique-id</var>&gt;</code></td><td width="37%"></td></tr>
<tr><td width="28%"><code class="code">closed-stream</code></td><td width="35%"><code class="code">#&lt;closed ...&gt;</code></td><td width="37%">The dots denote any of the above stream forms.</td></tr>
</tbody>
</table>
<div class="caption"><p><strong class="strong">Table 2.11: </strong>Implementation-specific printed representation</p></div></div>
<ul class="mini-toc">
<li><a href="Printer.html#C-Reference-19" accesskey="1">C Reference</a></li>
</ul>
<div class="subsection-level-extent" id="C-Reference-19">
<h4 class="subsection">2.20.1 C Reference</h4>
<ul class="mini-toc">
<li><a href="Printer.html#ANSI-Dictionary-11" accesskey="1">ANSI Dictionary</a></li>
</ul>
<div class="subsubsection-level-extent" id="ANSI-Dictionary-11">
<h4 class="subsubsection">2.20.1.1 ANSI Dictionary</h4>
<p>Common Lisp and C equivalence
</p>
<table class="multitable">
<thead><tr><th width="30%">Lisp symbol</th><th width="70%">C function</th></tr></thead>
<tbody><tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_cp_ppr.htm">copy-pprint-dispatch</a></td><td width="70%">cl_object cl_copy_pprint_dispatch(cl_narg narg, ...)</td></tr>
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_ppr_di.htm">pprint-dispatch</a></td><td width="70%">cl_object cl_pprint_dispatch(cl_narg narg, cl_object object, ...)</td></tr>
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_ppr_fi.htm">pprint-fill</a></td><td width="70%">cl_object cl_pprint_fill(cl_narg narg, cl_object stream, cl_object object, ...)</td></tr>
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_ppr_fi.htm">pprint-linear</a></td><td width="70%">cl_object cl_pprint_linear(cl_narg narg, cl_object stream, cl_object object, ...)</td></tr>
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_ppr_fi.htm">pprint-tabular</a></td><td width="70%">cl_object cl_pprint_tabular(cl_narg narg, cl_object stream, cl_object object, ...)</td></tr>
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_ppr_in.htm">pprint-indent</a></td><td width="70%">cl_object cl_pprint_indent(cl_narg narg, cl_object relative_to, cl_object n, ...)</td></tr>
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_ppr_nl.htm">pprint-newline</a></td><td width="70%">cl_object cl_pprint_newline(cl_narg narg, cl_object kind, ...)</td></tr>
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_ppr_ta.htm">pprint-tab</a></td><td width="70%">cl_object cl_pprint_tab(cl_narg narg, cl_object kind, cl_object colnum, cl_object colinc, ...)</td></tr>
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_pr_obj.htm">print-object</a></td><td width="70%">[Only in Common Lisp]</td></tr>
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_set_pp.htm">set-pprint-dispatch</a></td><td width="70%">cl_object cl_set_pprint_dispatch(cl_narg narg, cl_object ype_spec, cl_object function, ...)</td></tr>
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_wr_pr.htm">write</a></td><td width="70%">cl_object cl_write(cl_narg narg, cl_object object, ...)</td></tr>
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_wr_pr.htm">prin1</a></td><td width="70%">cl_object cl_prin1(cl_narg narg, cl_object object, ...)</td></tr>
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_wr_pr.htm">princ</a></td><td width="70%">cl_object cl_princ(cl_narg narg, cl_object object, ...)</td></tr>
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_wr_pr.htm">print</a></td><td width="70%">cl_object cl_print(cl_narg narg, cl_object object, ...)</td></tr>
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_wr_pr.htm">pprint</a></td><td width="70%">cl_object cl_pprint(cl_narg narg, cl_object object, ...)</td></tr>
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_wr_to_.htm">write-to-string</a></td><td width="70%">cl_object cl_write_to_string(cl_narg narg, cl_object object, ...)</td></tr>
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_wr_to_.htm">prin1-to-string</a></td><td width="70%">cl_object cl_prin1_to_string(cl_object object)</td></tr>
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_wr_to_.htm">princ-to-string</a></td><td width="70%">cl_object cl_princ_to_string(cl_object object)</td></tr>
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_pr_not.htm">print-not-readable-object</a></td><td width="70%">[Only in Common Lisp]</td></tr>
<tr><td width="30%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_format.htm">format</a></td><td width="70%">cl_object cl_format(cl_narg narg, cl_object stream, cl_object string, ...)</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<hr>
<div class="nav-panel">
<p>
Next: <a href="Reader.html" accesskey="n" rel="next">Reader</a>, Previous: <a href="Streams.html#Streams" accesskey="p" rel="prev">Streams</a>, Up: <a href="Standards.html" accesskey="u" rel="up">Standards</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Indexes.html" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>