1
0
Fork 0
cl-sites/HyperSpec-7-0/HyperSpec/Body/22_aaa.htm

62 lines
6.7 KiB
HTML
Raw Normal View History

2024-04-01 10:24:07 +02:00
<!-- 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 22.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="22_aa.htm">
<LINK REL=UP HREF="22_aa.htm">
<LINK REL=NEXT HREF="22_aaaa.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="22_aa.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="22_aa.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="22_aaaa.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
<HR>
<H2>
22.1.1.1 Multiple Possible Textual Representations</H2> <P>
Most <A REL=DEFINITION HREF="26_glo_o.htm#object"><I>objects</I></A> have more than one possible textual representation. For example, the positive <A REL=DEFINITION HREF="26_glo_i.htm#integer"><I>integer</I></A> with a magnitude of twenty-seven can be textually expressed in any of these ways: <P>
<PRE>
27 27. #o33 #x1B #b11011 #.(* 3 3 3) 81/3
</PRE>
</TT> <P>
A list containing the two symbols <TT>A</TT> and <TT>B</TT> can also be textually expressed in a variety of ways: <P>
<PRE>
(A B) (a b) ( a b ) (\A |B|)
(|\A|
B
)
</PRE>
</TT> <P>
In general, from the point of view of the <A REL=DEFINITION HREF="26_glo_l.htm#lisp_reader"><I>Lisp reader</I></A>, wherever <A REL=DEFINITION HREF="26_glo_w.htm#whitespace"><I>whitespace</I></A> is permissible in a textual representation, any number of <A REL=DEFINITION HREF="26_glo_s.htm#space"><I>spaces</I></A> and <A REL=DEFINITION HREF="26_glo_n.htm#newline"><I>newlines</I></A> can appear in <A REL=DEFINITION HREF="26_glo_s.htm#standard_syntax"><I>standard syntax</I></A>. <P>
When a function such as <A REL=DEFINITION HREF="f_wr_pr.htm#print"><B>print</B></A> produces a printed representation, it must choose from among many possible textual representations. In most cases, it chooses a program readable representation, but in certain cases it might use a more compact notation that is not program-readable. <P>
A number of option variables, called <A REL=DEFINITION HREF="26_glo_p.htm#printer_control_variable"><I>printer control variables</I></A>, are provided to permit control of individual aspects of the printed representation of <A REL=DEFINITION HREF="26_glo_o.htm#object"><I>objects</I></A>. The next figure shows the <A REL=DEFINITION HREF="26_glo_s.htm#standardized"><I>standardized</I></A> <A REL=DEFINITION HREF="26_glo_p.htm#printer_control_variable"><I>printer control variables</I></A>; there might also be <A REL=DEFINITION HREF="26_glo_i.htm#implementation-defined"><I>implementation-defined</I></A> <A REL=DEFINITION HREF="26_glo_p.htm#printer_control_variable"><I>printer control variables</I></A>. <P>
<A NAME="stdprintercontrolvars"> <PRE>
<A REL=DEFINITION HREF="v_pr_ar.htm#STprint-arrayST">*print-array*</A> <A REL=DEFINITION HREF="v_pr_gen.htm#STprint-gensymST">*print-gensym*</A> <A REL=DEFINITION HREF="v_pr_ppr.htm#STprint-pprint-dispatchST">*print-pprint-dispatch*</A>
<A REL=DEFINITION HREF="v_pr_bas.htm#STprint-baseST">*print-base*</A> <A REL=DEFINITION HREF="v_pr_lev.htm#STprint-lengthST">*print-length*</A> <A REL=DEFINITION HREF="v_pr_pre.htm#STprint-prettyST">*print-pretty*</A>
<A REL=DEFINITION HREF="v_pr_cas.htm#STprint-caseST">*print-case*</A> <A REL=DEFINITION HREF="v_pr_lev.htm#STprint-levelST">*print-level*</A> <A REL=DEFINITION HREF="v_pr_bas.htm#STprint-radixST">*print-radix*</A>
<A REL=DEFINITION HREF="v_pr_cir.htm#STprint-circleST">*print-circle*</A> <A REL=DEFINITION HREF="v_pr_lin.htm#STprint-linesST">*print-lines*</A> <A REL=DEFINITION HREF="v_pr_rda.htm#STprint-readablyST">*print-readably*</A>
<A REL=DEFINITION HREF="v_pr_esc.htm#STprint-escapeST">*print-escape*</A> <A REL=DEFINITION HREF="v_pr_mis.htm#STprint-miser-widthST">*print-miser-width*</A> <A REL=DEFINITION HREF="v_pr_rig.htm#STprint-right-marginST">*print-right-margin*</A>
</PRE>
<P><B>Figure 22-1. Standardized Printer Control Variables</B></A> <P>
In addition to the <A REL=DEFINITION HREF="26_glo_p.htm#printer_control_variable"><I>printer control variables</I></A>, the following additional <A REL=DEFINITION HREF="26_glo_d.htm#defined_name"><I>defined names</I></A> relate to or affect the behavior of the <A REL=DEFINITION HREF="26_glo_l.htm#lisp_printer"><I>Lisp printer</I></A>: <P>
<PRE>
<A REL=DEFINITION HREF="v_pkg.htm#STpackageST">*package*</A> <A REL=DEFINITION HREF="v_rd_eva.htm#STread-evalST">*read-eval*</A> <A REL=DEFINITION HREF="f_rdtabl.htm#readtable-case">readtable-case</A>
<A REL=DEFINITION HREF="v_rd_def.htm#STread-default-float-formatST">*read-default-float-format*</A> <A REL=DEFINITION HREF="v_rdtabl.htm#STreadtableST">*readtable*</A>
</PRE>
<P><B>Figure 22-2. Additional Influences on the Lisp printer.</B> <P>
<A REL=CHILD HREF="22_aaaa.htm"><H2>
22.1.1.1.1 Printer Escaping</H2></A><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/iss277.htm">PRINTER-WHITESPACE:JUST-ONE-SPACE</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>