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

47 lines
4.8 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</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_a.htm">
<LINK REL=UP HREF="21_a.htm">
<LINK REL=NEXT HREF="21_aaa.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_a.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="21_a.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="21_aaa.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
<HR>
<H2>
21.1.1 Introduction to Streams</H2> <P>
A <A REL=DEFINITION HREF="26_glo_s.htm#stream"><I>stream</I></A> is an <A REL=DEFINITION HREF="26_glo_o.htm#object"><I>object</I></A> that can be used with an input or output function to identify an appropriate source or sink of <A REL=DEFINITION HREF="26_glo_c.htm#character"><I>characters</I></A> or <A REL=DEFINITION HREF="26_glo_b.htm#byte"><I>bytes</I></A> for that operation. 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> is a source or sink of <A REL=DEFINITION HREF="26_glo_c.htm#character"><I>characters</I></A>. 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> is a source or sink of <A REL=DEFINITION HREF="26_glo_b.htm#byte"><I>bytes</I></A>. <P>
Some operations may be performed on any kind of <A REL=DEFINITION HREF="26_glo_s.htm#stream"><I>stream</I></A>; the next figure provides a list of <A REL=DEFINITION HREF="26_glo_s.htm#standardized"><I>standardized</I></A> operations that are potentially useful with any kind of <A REL=DEFINITION HREF="26_glo_s.htm#stream"><I>stream</I></A>. <P>
<PRE>
<A REL=DEFINITION HREF="f_close.htm#close">close</A> <A REL=DEFINITION HREF="f_stm_el.htm#stream-element-type">stream-element-type</A>
<A REL=DEFINITION HREF="f_in_stm.htm#input-stream-p">input-stream-p</A> <A REL=DEFINITION HREF="f_stmp.htm#streamp">streamp</A>
<A REL=DEFINITION HREF="f_intera.htm#interactive-stream-p">interactive-stream-p</A> <A REL=DEFINITION HREF="m_w_op_1.htm#with-open-stream">with-open-stream</A>
<A REL=DEFINITION HREF="f_in_stm.htm#output-stream-p">output-stream-p</A>
</PRE>
<P><B>Figure 21-1. Some General-Purpose Stream Operations</B> <P>
Other operations are only meaningful on certain <A REL=DEFINITION HREF="26_glo_s.htm#stream"><I>stream</I></A> <A REL=DEFINITION HREF="26_glo_t.htm#type"><I>types</I></A>. For example, <A REL=DEFINITION HREF="f_rd_cha.htm#read-char"><B>read-char</B></A> is only defined for <A REL=DEFINITION HREF="26_glo_c.htm#character"><I>character</I></A> <A REL=DEFINITION HREF="26_glo_s.htm#stream"><I>streams</I></A> and <A REL=DEFINITION HREF="f_rd_by.htm#read-byte"><B>read-byte</B></A> is only defined for <A REL=DEFINITION HREF="26_glo_b.htm#binary"><I>binary</I></A> <A REL=DEFINITION HREF="26_glo_s.htm#stream"><I>streams</I></A>. <P>
<A REL=CHILD HREF="21_aaa.htm"><H2>
21.1.1.1 Abstract Classifications of Streams</H2></A><P>
<A REL=CHILD HREF="21_aab.htm"><H2>
21.1.1.2 Abstract Classifications of Streams</H2></A><P>
<A REL=CHILD HREF="21_aac.htm"><H2>
21.1.1.3 Other Subclasses of Stream</H2></A><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>