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

70 lines
9.9 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: Variable *READ-SUPPRESS*</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="v_rd_eva.htm">
<LINK REL=UP HREF="c_reader.htm">
<LINK REL=NEXT HREF="v_rdtabl.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="v_rd_eva.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="c_reader.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="v_rdtabl.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
<HR>
<A NAME="STread-suppressST"><I>Variable</I> <B>*READ-SUPPRESS*</B></A> <P>
<P><B>Value Type:</B><P>
<P>
a <A REL=DEFINITION HREF="26_glo_g.htm#generalized_boolean"><I>generalized boolean</I></A>. <P>
<P><B>Initial Value:</B><P>
<P>
<A REL=DEFINITION HREF="26_glo_f.htm#false"><I>false</I></A>. <P>
<P><B>Description:</B><P>
<P>
This variable is intended primarily to support the operation of the read-time conditional notations <TT>#+</TT> and <TT>#-</TT>. It is important for the <A REL=DEFINITION HREF="26_glo_r.htm#reader_macro"><I>reader macros</I></A> which implement these notations to be able to skip over the printed representation of an <A REL=DEFINITION HREF="26_glo_e.htm#expression"><I>expression</I></A> despite the possibility that the syntax of the skipped <A REL=DEFINITION HREF="26_glo_e.htm#expression"><I>expression</I></A> may not be entirely valid for the current implementation, since <TT>#+</TT> and <TT>#-</TT> exist in order to allow the same program to be shared among several Lisp implementations (including dialects other than Common Lisp) despite small incompatibilities of syntax. <P>
If it is <A REL=DEFINITION HREF="26_glo_f.htm#false"><I>false</I></A>, the <A REL=DEFINITION HREF="26_glo_l.htm#lisp_reader"><I>Lisp reader</I></A> operates normally. <P>
<P>
If the <A REL=DEFINITION HREF="26_glo_v.htm#value"><I>value</I></A> of <A REL=DEFINITION HREF="#STread-suppressST"><B>*read-suppress*</B></A> is <A REL=DEFINITION HREF="26_glo_t.htm#true"><I>true</I></A>, <A REL=DEFINITION HREF="f_rd_rd.htm#read"><B>read</B></A>, <A REL=DEFINITION HREF="f_rd_rd.htm#read-preserving-whitespace"><B>read-preserving-whitespace</B></A>, <A REL=DEFINITION HREF="f_rd_del.htm#read-delimited-list"><B>read-delimited-list</B></A>, and <A REL=DEFINITION HREF="f_rd_fro.htm#read-from-string"><B>read-from-string</B></A> all return a <A REL=DEFINITION HREF="26_glo_p.htm#primary_value"><I>primary value</I></A> of <A REL=DEFINITION HREF="a_nil.htm#nil"><B>nil</B></A> when they complete successfully; however, they continue to parse the representation of an <A REL=DEFINITION HREF="26_glo_o.htm#object"><I>object</I></A> in the normal way, in order to skip over the <A REL=DEFINITION HREF="26_glo_o.htm#object"><I>object</I></A>, and continue to indicate <A REL=DEFINITION HREF="26_glo_e.htm#end_of_file"><I>end of file</I></A> in the normal way. Except as noted below, any <A REL=DEFINITION HREF="26_glo_s.htm#standardized"><I>standardized</I></A> <A REL=DEFINITION HREF="26_glo_r.htm#reader_macro"><I>reader macro</I></A>[2] that is defined to <A REL=DEFINITION HREF="26_glo_r.htm#read"><I>read</I></A>[2] a following <A REL=DEFINITION HREF="26_glo_o.htm#object"><I>object</I></A> or <A REL=DEFINITION HREF="26_glo_t.htm#token"><I>token</I></A> will do so, but not signal an error if the <A REL=DEFINITION HREF="26_glo_o.htm#object"><I>object</I></A> read is not of an appropriate type or syntax. The <A REL=DEFINITION HREF="26_glo_s.htm#standard_syntax"><I>standard syntax</I></A> and its associated <A REL=DEFINITION HREF="26_glo_r.htm#reader_macro"><I>reader macros</I></A> will not construct any new <A REL=DEFINITION HREF="26_glo_o.htm#object"><I>objects</I></A> (e.g., when reading the representation of a <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A>, no <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A> will be constructed or interned). <P>
<P><DL><P>
<DT>Extended tokens <P><DD>
All extended tokens are completely uninterpreted. Errors such as those that might otherwise be signaled due to detection of invalid <A REL=DEFINITION HREF="26_glo_p.htm#potential_number"><I>potential numbers</I></A>, invalid patterns of <A REL=DEFINITION HREF="26_glo_p.htm#package_marker"><I>package markers</I></A>, and invalid uses of the <A REL=DEFINITION HREF="26_glo_d.htm#dot"><I>dot</I></A> character are suppressed. <P>
<DT>Dispatching macro characters (including <A REL=DEFINITION HREF="26_glo_s.htm#sharpsign"><I>sharpsign</I></A>) <P><DD>
<A REL=DEFINITION HREF="26_glo_d.htm#dispatching_macro_character"><I>Dispatching macro characters</I></A> continue to parse an infix numerical argument, and invoke the dispatch function. The <A REL=DEFINITION HREF="26_glo_s.htm#standardized"><I>standardized</I></A> <A REL=DEFINITION HREF="26_glo_s.htm#sharpsign"><I>sharpsign</I></A> <A REL=DEFINITION HREF="26_glo_r.htm#reader_macro"><I>reader macros</I></A> do not enforce any constraints on either the presence of or the value of the numerical argument. <P>
<P>
<DT><TT>#=</TT> <P><DD>
The <TT>#=</TT> notation is totally ignored. It does not read a following <A REL=DEFINITION HREF="26_glo_o.htm#object"><I>object</I></A>. It produces no <A REL=DEFINITION HREF="26_glo_o.htm#object"><I>object</I></A>, but is treated as <A REL=DEFINITION HREF="26_glo_w.htm#whitespace"><I>whitespace</I></A>[2]. <P>
<DT><TT>##</TT> <P><DD>
The <TT>##</TT> notation always produces <A REL=DEFINITION HREF="a_nil.htm#nil"><B>nil</B></A>. <P></DL><P>
No matter what the <A REL=DEFINITION HREF="26_glo_v.htm#value"><I>value</I></A> of <A REL=DEFINITION HREF="#STread-suppressST"><B>*read-suppress*</B></A>, parentheses still continue to delimit and construct <A REL=DEFINITION HREF="26_glo_l.htm#list"><I>lists</I></A>; the <TT>#(</TT> notation continues to delimit <A REL=DEFINITION HREF="26_glo_v.htm#vector"><I>vectors</I></A>; and comments, <A REL=DEFINITION HREF="26_glo_s.htm#string"><I>strings</I></A>, and the <A REL=DEFINITION HREF="26_glo_s.htm#single-quote"><I>single-quote</I></A> and <A REL=DEFINITION HREF="26_glo_b.htm#backquote"><I>backquote</I></A> notations continue to be interpreted properly. Such situations as <TT>')</TT>, <TT>#&lt;</TT>, <TT>#)</TT>, and <TT>#&lt;Space&gt;</TT> continue to signal errors. <P>
<P><B>Examples:</B><P>
<P>
<PRE>
(let ((*read-suppress* t))
(mapcar #'read-from-string
'(&quot;#(foo bar baz)&quot; &quot;#P(:type :lisp)&quot; &quot;#c1.2&quot;
&quot;#.(PRINT 'FOO)&quot; &quot;#3AHELLO&quot; &quot;#S(INTEGER)&quot;
&quot;#*ABC&quot; &quot;#\GARBAGE&quot; &quot;#RALPHA&quot; &quot;#3R444&quot;)))
=&gt; (NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL)
</PRE>
</TT> <P>
<P><B>Affected By:</B> None.
<P>
<P><B>See Also:</B><P>
<P>
<A REL=DEFINITION HREF="f_rd_rd.htm#read"><B>read</B></A>, <A REL=CHILD HREF="02_.htm">Section 2 (Syntax)</A> <P>
<P><B>Notes:</B><P>
<P>
<A REL=DEFINITION HREF="26_glo_p.htm#programmer"><I>Programmers</I></A> and <A REL=DEFINITION HREF="26_glo_i.htm#implementation"><I>implementations</I></A> that define additional <A REL=DEFINITION HREF="26_glo_m.htm#macro_character"><I>macro characters</I></A> are strongly encouraged to make them respect <A REL=DEFINITION HREF="#STread-suppressST"><B>*read-suppress*</B></A> just as <A REL=DEFINITION HREF="26_glo_s.htm#standardized"><I>standardized</I></A> <A REL=DEFINITION HREF="26_glo_m.htm#macro_character"><I>macro characters</I></A> do. That is, when the <A REL=DEFINITION HREF="26_glo_v.htm#value"><I>value</I></A> of <A REL=DEFINITION HREF="#STread-suppressST"><B>*read-suppress*</B></A> is <A REL=DEFINITION HREF="26_glo_t.htm#true"><I>true</I></A>, they should ignore type errors when reading a following <A REL=DEFINITION HREF="26_glo_o.htm#object"><I>object</I></A> and the <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>functions</I></A> that implement <A REL=DEFINITION HREF="26_glo_d.htm#dispatching_macro_character"><I>dispatching macro characters</I></A> should tolerate <A REL=DEFINITION HREF="a_nil.htm#nil"><B>nil</B></A> as their infix <A REL=DEFINITION HREF="26_glo_p.htm#parameter"><I>parameter</I></A> value even if a numeric value would ordinarily be required. <P>
<P><HR>The following <A REL=META HREF="../Front/X3J13Iss.htm">X3J13 cleanup issue</A>, <I>not part of the specification</I>, applies to this section:<P><UL><LI> <A REL=CHILD HREF="../Issues/iss288.htm">READ-SUPPRESS-CONFUSING:GENERALIZE</A><P></UL><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>