1
0
Fork 0
cl-sites/HyperSpec-7-0/HyperSpec/Body/21_aaaa.htm
2024-04-01 10:24:07 +02:00

53 lines
7.3 KiB
HTML

<!-- Common Lisp HyperSpec (TM), version 7.0 generated by Kent M. Pitman on Mon, 11-Apr-2005 2:31am EDT -->
<HTML>
<HEAD>
<TITLE>CLHS: Section 21.1.1.1.1</TITLE>
<LINK HREF="../Data/clhs.css" REL="stylesheet" TYPE="text/css" />
<META HTTP-EQUIV="Author" CONTENT="Kent M. Pitman">
<META HTTP-EQUIV="Organization" CONTENT="LispWorks Ltd.">
<LINK REL=TOP HREF="../Front/index.htm">
<LINK REL=COPYRIGHT HREF="../Front/Help.htm#Legal">
<LINK REL=DISCLAIMER HREF="../Front/Help.htm#Disclaimer">
<LINK REL=PREV HREF="21_aaa.htm">
<LINK REL=UP HREF="21_aaa.htm">
<LINK REL=NEXT HREF="21_aaab.htm">
</HEAD>
<BODY>
<H1><A REV=MADE HREF="http://www.lispworks.com/"><IMG WIDTH=80 HEIGHT=65 ALT="[LISPWORKS]" SRC="../Graphics/LWSmall.gif" ALIGN=Bottom></A><A REL=TOP HREF="../Front/index.htm"><IMG WIDTH=237 HEIGHT=65 ALT="[Common Lisp HyperSpec (TM)]" SRC="../Graphics/CLHS_Sm.gif" ALIGN=Bottom></A> <A REL=PREV HREF="21_aaa.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="21_aaa.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="21_aaab.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
<HR>
<H2>
21.1.1.1.1 Input, Output, and Bidirectional Streams</H2> <P>
A <A REL=DEFINITION HREF="26_glo_s.htm#stream"><I>stream</I></A>, whether a <A REL=DEFINITION HREF="26_glo_c.htm#character"><I>character</I></A> <A REL=DEFINITION HREF="26_glo_s.htm#stream"><I>stream</I></A> or a <A REL=DEFINITION HREF="26_glo_b.htm#binary"><I>binary</I></A> <A REL=DEFINITION HREF="26_glo_s.htm#stream"><I>stream</I></A>, can be an <A REL=DEFINITION HREF="26_glo_i.htm#input"><I>input</I></A> <A REL=DEFINITION HREF="26_glo_s.htm#stream"><I>stream</I></A> (source of data), an <A REL=DEFINITION HREF="26_glo_o.htm#output"><I>output</I></A> <A REL=DEFINITION HREF="26_glo_s.htm#stream"><I>stream</I></A> (sink for data), both, or (e.g., when ``<TT>:direction :probe</TT>'' is given to <A REL=DEFINITION HREF="f_open.htm#open"><B>open</B></A>) neither. <P>
The next figure shows <A REL=DEFINITION HREF="26_glo_o.htm#operator"><I>operators</I></A> relating to <A REL=DEFINITION HREF="26_glo_i.htm#input"><I>input</I></A> <A REL=DEFINITION HREF="26_glo_s.htm#stream"><I>streams</I></A>. <P>
<A NAME="inputstreamops"> <PRE>
<A REL=DEFINITION HREF="f_clear_.htm#clear-input">clear-input</A> <A REL=DEFINITION HREF="f_rd_by.htm#read-byte">read-byte</A> <A REL=DEFINITION HREF="f_rd_fro.htm#read-from-string">read-from-string</A>
<A REL=DEFINITION HREF="f_listen.htm#listen">listen</A> <A REL=DEFINITION HREF="f_rd_cha.htm#read-char">read-char</A> <A REL=DEFINITION HREF="f_rd_lin.htm#read-line">read-line</A>
<A REL=DEFINITION HREF="f_peek_c.htm#peek-char">peek-char</A> <A REL=DEFINITION HREF="f_rd_c_1.htm#read-char-no-hang">read-char-no-hang</A> <A REL=DEFINITION HREF="f_rd_rd.htm#read-preserving-whitespace">read-preserving-whitespace</A>
<A REL=DEFINITION HREF="f_rd_rd.htm#read">read</A> <A REL=DEFINITION HREF="f_rd_del.htm#read-delimited-list">read-delimited-list</A> <A REL=DEFINITION HREF="f_unrd_c.htm#unread-char">unread-char</A>
</PRE>
<P><B>Figure 21-2. Operators relating to Input Streams.</B></A> <P>
The next figure shows <A REL=DEFINITION HREF="26_glo_o.htm#operator"><I>operators</I></A> relating to <A REL=DEFINITION HREF="26_glo_o.htm#output"><I>output</I></A> <A REL=DEFINITION HREF="26_glo_s.htm#stream"><I>streams</I></A>. <P>
<A NAME="outputstreamops"> <PRE>
<A REL=DEFINITION HREF="f_finish.htm#clear-output">clear-output</A> <A REL=DEFINITION HREF="f_wr_pr.htm#prin1">prin1</A> <A REL=DEFINITION HREF="f_wr_pr.htm#write">write</A>
<A REL=DEFINITION HREF="f_finish.htm#finish-output">finish-output</A> <A REL=DEFINITION HREF="f_wr_to_.htm#prin1-to-string">prin1-to-string</A> <A REL=DEFINITION HREF="f_wr_by.htm#write-byte">write-byte</A>
<A REL=DEFINITION HREF="f_finish.htm#force-output">force-output</A> <A REL=DEFINITION HREF="f_wr_pr.htm#princ">princ</A> <A REL=DEFINITION HREF="f_wr_cha.htm#write-char">write-char</A>
<A REL=DEFINITION HREF="f_format.htm#format">format</A> <A REL=DEFINITION HREF="f_wr_to_.htm#princ-to-string">princ-to-string</A> <A REL=DEFINITION HREF="f_wr_stg.htm#write-line">write-line</A>
<A REL=DEFINITION HREF="f_terpri.htm#fresh-line">fresh-line</A> <A REL=DEFINITION HREF="f_wr_pr.htm#print">print</A> <A REL=DEFINITION HREF="f_wr_stg.htm#write-string">write-string</A>
<A REL=DEFINITION HREF="f_wr_pr.htm#pprint">pprint</A> <A REL=DEFINITION HREF="f_terpri.htm#terpri">terpri</A> <A REL=DEFINITION HREF="f_wr_to_.htm#write-to-string">write-to-string</A>
</PRE>
<P><B>Figure 21-3. Operators relating to Output Streams.</B></A> <P>
A <A REL=DEFINITION HREF="26_glo_s.htm#stream"><I>stream</I></A> that is both an <A REL=DEFINITION HREF="26_glo_i.htm#input"><I>input</I></A> <A REL=DEFINITION HREF="26_glo_s.htm#stream"><I>stream</I></A> and an <A REL=DEFINITION HREF="26_glo_o.htm#output"><I>output</I></A> <A REL=DEFINITION HREF="26_glo_s.htm#stream"><I>stream</I></A> is called a <A REL=DEFINITION HREF="26_glo_b.htm#bidirectional"><I>bidirectional</I></A> <A REL=DEFINITION HREF="26_glo_s.htm#stream"><I>stream</I></A>. See the <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>functions</I></A> <A REL=DEFINITION HREF="f_in_stm.htm#input-stream-p"><B>input-stream-p</B></A> and <A REL=DEFINITION HREF="f_in_stm.htm#output-stream-p"><B>output-stream-p</B></A>. <P>
Any of the <A REL=DEFINITION HREF="26_glo_o.htm#operator"><I>operators</I></A> listed in <A REL=DEFINITION HREF="#inputstreamops">Figure 21-2</A> or <A REL=DEFINITION HREF="#outputstreamops">Figure 21-3</A> an be used with <A REL=DEFINITION HREF="26_glo_b.htm#bidirectional"><I>bidirectional</I></A> <A REL=DEFINITION HREF="26_glo_s.htm#stream"><I>streams</I></A>. In addition, the next figure hows a list of <A REL=DEFINITION HREF="26_glo_o.htm#operator"><I>operators</I></A> that relate specificaly to <A REL=DEFINITION HREF="26_glo_b.htm#bidirectional"><I>bidirectional</I></A> <A REL=DEFINITION HREF="26_glo_s.htm#stream"><I>streams</I></A>. <P>
<PRE>
<A REL=DEFINITION HREF="f_y_or_n.htm#y-or-n-p">y-or-n-p</A> <A REL=DEFINITION HREF="f_y_or_n.htm#yes-or-no-p">yes-or-no-p</A>
</PRE>
<P><B>Figure 21-4. Operators relating to Bidirectional Streams.</B> <P>
<HR>
<A REL=NAVIGATOR HREF="../Front/StartPts.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Starting Points]" SRC="../Graphics/StartPts.gif" ALIGN=Bottom></A><A REL=TOC HREF="../Front/Contents.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Contents]" SRC="../Graphics/Contents.gif" ALIGN=Bottom></A><A REL=INDEX HREF="../Front/X_Master.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Index]" SRC="../Graphics/Index.gif" ALIGN=Bottom></A><A REL=INDEX HREF="../Front/X_Symbol.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Symbols]" SRC="../Graphics/Symbols.gif" ALIGN=Bottom></A><A REL=GLOSSARY HREF="../Body/26_a.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Glossary]" SRC="../Graphics/Glossary.gif" ALIGN=Bottom></A><A HREF="../Front/X3J13Iss.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Issues]" SRC="../Graphics/Issues.gif" ALIGN=Bottom></A><BR>
<A REL=COPYRIGHT HREF="../Front/Help.htm#Legal"><I>Copyright 1996-2005, LispWorks Ltd. All rights reserved.</I></A><P>
</BODY>
</HTML>