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

47 lines
4.7 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 22.2.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_b.htm">
<LINK REL=UP HREF="22_b.htm">
<LINK REL=NEXT HREF="22_baa.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_b.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="22_b.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="22_baa.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
<HR>
<H2>
22.2.1 Pretty Printer Concepts</H2> <P>
The facilities provided by the <A REL=DEFINITION HREF="26_glo_p.htm#pretty_printer"><I>pretty printer</I></A> permit <A REL=DEFINITION HREF="26_glo_p.htm#program"><I>programs</I></A> to redefine the way in which <A REL=DEFINITION HREF="26_glo_c.htm#code"><I>code</I></A> is displayed, and allow the full power of <I>pretty printing</I> to be applied to complex combinations of data structures. <P>
Whether any given style of output is in fact ``pretty'' is inherently a somewhat subjective issue. However, since the effect of the <A REL=DEFINITION HREF="26_glo_p.htm#pretty_printer"><I>pretty printer</I></A> can be customized by <A REL=DEFINITION HREF="26_glo_c.htm#conforming_program"><I>conforming programs</I></A>, the necessary flexibility is provided for individual <A REL=DEFINITION HREF="26_glo_p.htm#program"><I>programs</I></A> to achieve an arbitrary degree of aesthetic control. <P>
By providing direct access to the mechanisms within the pretty printer that make dynamic decisions about layout, the macros and functions <A REL=DEFINITION HREF="m_ppr_lo.htm#pprint-logical-block"><B>pprint-logical-block</B></A>, <A REL=DEFINITION HREF="f_ppr_nl.htm#pprint-newline"><B>pprint-newline</B></A>, and <A REL=DEFINITION HREF="f_ppr_in.htm#pprint-indent"><B>pprint-indent</B></A> make it possible to specify pretty printing layout rules as a part of any function that produces output. They also make it very easy for the detection of circularity and sharing, and abbreviation based on length and nesting depth to be supported by the function. <P>
The <A REL=DEFINITION HREF="26_glo_p.htm#pretty_printer"><I>pretty printer</I></A> is driven entirely by dispatch based on the <A REL=DEFINITION HREF="26_glo_v.htm#value"><I>value</I></A> of <A REL=DEFINITION HREF="v_pr_ppr.htm#STprint-pprint-dispatchST"><B>*print-pprint-dispatch*</B></A>. The <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>function</I></A> <A REL=DEFINITION HREF="f_set_pp.htm#set-pprint-dispatch"><B>set-pprint-dispatch</B></A> makes it possible for <A REL=DEFINITION HREF="26_glo_c.htm#conforming_program"><I>conforming programs</I></A> to associate new pretty printing functions with a <A REL=DEFINITION HREF="26_glo_t.htm#type"><I>type</I></A>. <P>
<A REL=CHILD HREF="22_baa.htm"><H2>
22.2.1.1 Dynamic Control of the Arrangement of Output</H2></A><P>
<A REL=CHILD HREF="22_bab.htm"><H2>
22.2.1.2 Format Directive Interface</H2></A><P>
<A REL=CHILD HREF="22_bac.htm"><H2>
22.2.1.3 Compiling Format Strings</H2></A><P>
<A REL=CHILD HREF="22_bad.htm"><H2>
22.2.1.4 Pretty Print Dispatch Tables</H2></A><P>
<A REL=CHILD HREF="22_bae.htm"><H2>
22.2.1.5 Pretty Printer Margins</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>