1
0
Fork 0
cl-sites/ecl.common-lisp.dev/static/manual/Gray-Streams.html

231 lines
11 KiB
HTML
Raw Normal View History

2024-12-24 19:15:49 +01:00
<!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>Gray Streams (ECL Manual)</title>
<meta name="description" content="Gray Streams (ECL Manual)">
<meta name="keywords" content="Gray Streams (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="Extensions.html" rel="up" title="Extensions">
<link href="Tree-walker.html" rel="next" title="Tree walker">
<link href="Meta_002dObject-Protocol-_0028MOP_0029.html#Meta_002dObject-Protocol-_0028MOP_0029" rel="prev" title="Meta-Object Protocol (MOP)">
<style type="text/css">
<!--
/* colors */
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
span.r {font-family: initial; font-weight: normal; font-style: normal}
span:hover a.copiable-link {visibility: visible}
strong.def-name {font-family: monospace; font-weight: bold; font-size: larger}
@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="Gray-Streams">
<div class="nav-panel">
<p>
Next: <a href="Tree-walker.html" accesskey="n" rel="next">Tree walker</a>, Previous: <a href="Meta_002dObject-Protocol-_0028MOP_0029.html#Meta_002dObject-Protocol-_0028MOP_0029" accesskey="p" rel="prev">Meta-Object Protocol (MOP)</a>, Up: <a href="Extensions.html" accesskey="u" rel="up">Extensions</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="Gray-Streams-1">3.8 Gray Streams</h3>
<dl class="first-deffn first-defun-alias-first-deffn">
<dt class="deffn defun-alias-deffn" id="index-close"><span class="category-def">Function: </span><span><strong class="def-name">close</strong> <var class="def-var-arguments">stream &amp;key abort</var><a class="copiable-link" href='Gray-Streams.html#index-close'> &para;</a></span></dt>
<dd><p>Unlike the other Gray stream functions, <code class="code">close</code> is not specialized
on <code class="code">t</code> for <var class="var">stream</var>. This decision has been taken mainly for
the compatibility reasons with some libraries.
</p></dd></dl>
<dl class="first-deffn first-defun-alias-first-deffn">
<dt class="deffn defun-alias-deffn" id="index-stream_002dfile_002dposition"><span class="category-def">Function: </span><span><strong class="def-name">stream-file-position</strong> <var class="def-var-arguments">stream &amp;optional position</var><a class="copiable-link" href='Gray-Streams.html#index-stream_002dfile_002dposition'> &para;</a></span></dt>
<dd><p>This is used to implement <code class="code">file-position</code>. When <code class="code">position</code>
is not provided it should return the current file position of the
stream as non-negative integer or <code class="code">nil</code> if the file position
cannot be determined. When <code class="code">position</code> is supplied the file
position of the stream should be set to that value. If setting the
position is successful then <code class="code">t</code> should be returned, otherwise
<code class="code">nil</code> should be returned. The default method always returns
<code class="code">nil</code>.
</p></dd></dl>
<dl class="first-deffn first-defun-alias-first-deffn">
<dt class="deffn defun-alias-deffn" id="index-stream_002dfile_002dlength"><span class="category-def">Function: </span><span><strong class="def-name">stream-file-length</strong> <var class="def-var-arguments">stream</var><a class="copiable-link" href='Gray-Streams.html#index-stream_002dfile_002dlength'> &para;</a></span></dt>
<dd><p>This is used to implement <code class="code">file-length</code>. It returns either a
non-negative integer or <code class="code">nil</code> if the concept of file length is
not meaningful for the stream. The default method will signal a
<code class="code">type-error</code> with an expected type of <code class="code">file-stream</code>. This is
required to conform with the &ldquo;Exceptional Situations&rdquo; section of
<code class="code">file-length</code> in the ANSI specification.
</p></dd></dl>
<dl class="first-deffn first-defun-alias-first-deffn">
<dt class="deffn defun-alias-deffn" id="index-stream_002dinteractive_002dp"><span class="category-def">Function: </span><span><strong class="def-name">stream-interactive-p</strong> <var class="def-var-arguments">stream</var><a class="copiable-link" href='Gray-Streams.html#index-stream_002dinteractive_002dp'> &para;</a></span></dt>
<dd><p>This is used to implement <code class="code">interactive-stream-p</code>. It returns a
boolean indicating if the stream is interactive. The default method
always returns <code class="code">nil</code>.
</p></dd></dl>
<dl class="first-deffn first-defun-alias-first-deffn">
<dt class="deffn defun-alias-deffn" id="index-stream_002dline_002dlength"><span class="category-def">Function: </span><span><strong class="def-name">stream-line-length</strong> <var class="def-var-arguments">stream</var><a class="copiable-link" href='Gray-Streams.html#index-stream_002dline_002dlength'> &para;</a></span></dt>
<dd><p>Allows the default line length to be specified for the stream. It
returns either a non-negative integer or <code class="code">nil</code> if the concept of
line length is not meaningful for the stream. This value is only used
if <code class="code">*print-right-margin*</code> is <code class="code">nil</code>. The line length is used
by the pretty printer and by the format justification directive. The
default method returns <code class="code">nil</code>.
</p></dd></dl>
<dl class="first-deffn first-defun-alias-first-deffn">
<dt class="deffn defun-alias-deffn" id="index-stream_002dread_002dsequence"><span class="category-def">Function: </span><span><strong class="def-name">stream-read-sequence</strong> <var class="def-var-arguments">stream sequence &amp;optional start end</var><a class="copiable-link" href='Gray-Streams.html#index-stream_002dread_002dsequence'> &para;</a></span></dt>
<dd><p>This is used to implement <code class="code">read-sequence</code>. It should follow the
semantics in the ANSI specification. It returns the position of the
first element in the sequence that was not updated. The default method
calls <code class="code">stream-read-char</code> or <code class="code">stream-read-byte</code> repeatedly
based on the type returned by <code class="code">stream-element-type</code>. Element
access to the sequence is done via <code class="code">elt</code>.
</p></dd></dl>
<dl class="first-deffn first-defun-alias-first-deffn">
<dt class="deffn defun-alias-deffn" id="index-stream_002dwrite_002dsequence"><span class="category-def">Function: </span><span><strong class="def-name">stream-write-sequence</strong> <var class="def-var-arguments">stream sequence &amp;optional start end</var><a class="copiable-link" href='Gray-Streams.html#index-stream_002dwrite_002dsequence'> &para;</a></span></dt>
<dd><p>This is used to implement <code class="code">write-sequence</code>. It should follow the
semantics in the ANSI specification. It returns sequence without
modification. The default method calls <code class="code">stream-write-char</code> or
<code class="code">stream-write-byte</code> repeatedly based on the type returned by
<code class="code">stream-element-type</code>. Element access to the sequence is done via
<code class="code">elt</code>.
</p></dd></dl>
</div>
<hr>
<div class="nav-panel">
<p>
Next: <a href="Tree-walker.html" accesskey="n" rel="next">Tree walker</a>, Previous: <a href="Meta_002dObject-Protocol-_0028MOP_0029.html#Meta_002dObject-Protocol-_0028MOP_0029" accesskey="p" rel="prev">Meta-Object Protocol (MOP)</a>, Up: <a href="Extensions.html" accesskey="u" rel="up">Extensions</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>