1 % Copyright (C) 2008 Bert Burgemeister
3 % Permission is granted to copy, distribute and/or modify this
4 % document under the terms of the GNU Free Documentation License,
5 % Version 1.2 or any later version published by the Free Software
6 % Foundation; with no Invariant Sections, no Front-Cover Texts and
7 % no Back-Cover Texts. For details see file COPYING.
10 \newcommand{\maintitle}{Common\ Lisp\ Quick\ Reference
}
11 \newcommand{\AUTHOR}{Bert~Burgemeister
}
13 \documentclass[8pt,pagesize,twoside,footexclude,headexclude
]{scrartcl
}
16 % outsourced page dimensions
18 %\setlength{\paperwidth}{10.5cm}
19 %\setlength{\paperheight}{29.7cm}
20 %%\areaset[3mm]{9cm}{28.3cm}
25 % outsourced hypertext colors
27 %\newcommand{\linkcolor}{Fuchsia}
28 %\newcommand{\urlcolor}{MidnightBlue}
29 %\newcommand{\bookmarks}{true}
30 %\newcommand{\pdfpagelayout}{TwoColumnLeft}
41 \usepackage[usenames,
dvips]{color}
45 \definecolor{lightgray
}{gray
}{.85}
46 \usepackage[pagestyles
]{titlesec
}
50 % Two font alternatives:
51 % (A) All Computer Modern
55 % (B) Times mixed with Helvetica
56 %\usepackage{mathptmx}
57 %\usepackage[scaled]{helvet}
60 % should remain last usepackage:
62 [breaklinks,linktocpage,colorlinks,
%
63 bookmarksnumbered,bookmarks=
\bookmarks,
%
64 linkcolor=
\linkcolor,urlcolor=
\urlcolor,
%
65 pdfpagelayout=
\pdfpagelayout,
%
66 pdftitle=
\maintitle,pdfauthor=
\AUTHOR]%
70 \titleformat{\section}{\sffamily\mdseries\slshape}
71 {\huge\thesection}{.7em
}{\huge}[{\titlerule[0.25pt
]}]
73 \titleformat{\subsection}{\sffamily\mdseries\slshape}
74 {\Large\thesubsection}{.7em
}{\Large}[{\titlerule[0.25pt
]}]
76 % Kill toc header as we want it to span columns
78 \renewcommand{\toc@heading
}{}
81 \titlecontents{section
}
83 {\vspace{.5em plus
1em minus
.2em
}\sffamily\bfseries\upshape\filright}
84 {\contentslabel{1.5em
}}
86 {\hfill\contentspage\vspace{.1em
}}
88 \titlecontents{subsection
}
90 {\sffamily\mdseries\upshape\filright}
91 {\contentslabel{2.5em
}}
93 {\hspace{1ex
}\titlerule*
[1.5ex
]{.
}\contentspage}
95 \newlength{\LISTlinewidth}
96 \newenvironment{LIST
}[1]%
98 \LISTlinewidth=
\linewidth
101 {\setlength{\itemindent}{-
#1}\setlength{\leftmargin}{#1}}%
102 %\parskip0pt\itemsep0pt
108 %\renewcommand{\topfraction}{1}
109 \renewcommand{\bottomfraction}{1}
110 \renewcommand*
{\figureformat}{}
111 \renewcommand*
{\captionformat}{}
112 \renewcommand{\thefootnote}{\fnsymbol{footnote
}}
114 \setlength{\parfillskip}{5cm plus1cm minus3cm
}
115 \setlength{\arraycolsep}{0pt
}
118 \def\startexplanation{$
\triangleright$
\hskip1.4ex
}
121 \newlength{\ITtab}\ITtab=
3em
124 \settowidth{\ITwidth}{#1\unskip\hskip1em\hskip\ITtab}%
125 \ITrest=
\LISTlinewidth\advance\ITrest by -
\ITwidth%
126 \loop\ifdim\ITrest >
\ITtab%
127 \advance\ITrest by -
\ITtab%
130 \settowidth{\ITwidth}{%
131 #1\unskip\hskip1em\hskip\ITrest%
135 \ifdim\ITwidth <
\LISTlinewidth% Entry fits into a single line
136 #1\unskip\hskip1em\hskip\ITrest%
140 \unskip\penalty-
10000%
141 \parbox[t
]{\linewidth}{\startexplanation#2}%
146 \newpagestyle{lispref
}[\sffamily\mdseries\slshape]{
148 \sethead*
{}{}{\maintitle\/
}
149 \setfoot*
{}{}{\thepage\/
}}
154 \newcommand{\LIT}[1]{\text{{\fontfamily{cmtt
}\selectfont#1}}}
157 \newcommand{\VAR}[1]{\text{{\fontfamily{cmr
}\fontshape{it
}\selectfont#1\/
}}}
160 \newcommand{\NEV}[1]{\text{{$
\widehat{#1}$
}}}
163 \newcommand{\DF}[1]{\text{\textsubscript{\setlength{\fboxsep}{.5pt
}\setlength{\fboxrule}{.1pt
}\fbox{#1}}}}
165 % Optional Part, [], two sizes
166 \newcommand{\OP}[1]{{\text{$
\big[$
}{#1}\text{$
\big]$
}}}
167 \newcommand{\Op}[1]{{\text{$
[$
}{#1}\text{$
]$
}}}
170 \newcommand{\XOR}{\hspace{1pt
}\text{\rule[-
.9ex
]{.25pt
}{3ex
}}\hspace{1pt
}}
171 %\newcommand{\XOR}{\text{$\mid$}\hspace{0pt}}
174 \newcommand{\OPn}[1]{{{#1}\text{$
{}^
{*
}$
}}}
177 \newcommand{\RP}[1]{{{#1}\text{$
{}^
{+
}$
}}}
180 % Group of Objects {}, three sizes
181 \newcommand{\GOO}[1]{{\text{$
\Big\
{$
}{#1}\text{$
\Big\
}$
}}}
182 \newcommand{\GOo}[1]{{\text{$
\big\
{$
}{#1}\text{$
\big\
}$
}}}
183 \newcommand{\Goo}[1]{{\text{$\
{$
}{#1}\text{$\
}$
}}}
184 % Optional Group of Objects, {}*, three sizes
185 \newcommand{\GOOs}[1]{{$
\Big\
{$
{#1}$
\Big\
}^
{\!\!*
}$
}}
186 \newcommand{\GOos}[1]{\text{{$
\big\
{$
{#1}$
\big\
}^
{\!\!*
}$
}}}
187 \newcommand{\Goos}[1]{\text{{$\
{$
{#1}$\
}^
{\!*
}$
}}}
188 % Required Group of Objects, {}+, three sizes
189 \newcommand{\GOOp}[1]{{\text{$
\Big\
{$
}{#1}\text{$
\Big\
}^
{\!\!+
}$
}}}
190 \newcommand{\GOop}[1]{{\text{$
\big\
{$
}{#1}\text{$
\big\
}^
{\!\!+
}$
}}}
191 \newcommand{\Goop}[1]{{\text{$\
{$
}{#1}\text{$\
}^
{\!+
}$
}}}
193 % Vertically Arranged Group of Alternatives, {
194 % usage: \xorGOO{line1\\ line2...}{closing delimiter}
195 \newcommand{\xorGOO}[2]{\text{\(
%
203 % Vertically Arranged Group of Optional Objects, {|
204 % usage: \orGOO{line1\\line2}{closing delimiter}
205 \newcommand{\orGOO}[2]{\text{\(
%
213 % Vertically Arranged Group of Objects, No Opening {
214 % usage: \arrGOO{line1\\line2}{closing delimiter}
215 \newcommand{\arrGOO}[2]{\text{\(\!
%
223 % Boxed Group of Alternatives
224 % usage: \boxGOO{line1\\ line2...}
225 \newcommand{\boxGOO}[1]{\text{\hspace{1ex
}\(
%
226 \setlength{\fboxsep}{1pt
}\setlength{\fboxrule}{0pt
}
228 \setlength{\fboxsep}{1pt
}\setlength{\fboxrule}{.1pt
}
238 % In a Boxed Group of Alternatives: Replacement for \\ with additional
240 \newcommand{\boxGOOcr}{\vspace{1ex
}\\
}
243 % All sorts of keywords
244 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
246 % Generic Keyword, Lowercase
247 \newcommand{\kwd}[1]{\text{{\sffamily\bfseries\selectfont%
249 % Generic Keyword, Uppercase
250 \newcommand{\KWD}[1]{\text{{\sffamily\bfseries\selectfont%
253 \newcommand{\MC}[1]{\text{{\sffamily\bfseries\selectfont%
254 {\raisebox{1.4ex
}[1ex
][0pt
]{\tiny\sffamily\mdseries\makebox[0pt
][l
]{\hspace{.5em
}M
}}\lowercase{#1}}}}}
256 \newcommand{\SO}[1]{\text{{\sffamily\bfseries\selectfont%
257 {\raisebox{1.4ex
}[1ex
][0pt
]{\tiny\sffamily\mdseries\makebox[0pt
][l
]{\hspace{.5em
}SO
}}\lowercase{#1}}}}}
259 \newcommand{\FU}[1]{\text{{\sffamily\bfseries\selectfont%
260 {\raisebox{1.4ex
}[1ex
][0pt
]{\tiny\sffamily\mdseries\makebox[0pt
][l
]{\hspace{.5em
}Fu
}}\lowercase{#1}}}}}
262 \newcommand{\GFU}[1]{\text{{\sffamily\bfseries\selectfont%
263 {\raisebox{1.4ex
}[1ex
][0pt
]{\tiny\sffamily\mdseries\makebox[0pt
][l
]{\hspace{.5em
}gF
}}\lowercase{#1}}}}}
265 \newcommand{\V}[1]{\text{{\sffamily\bfseries\selectfont%
266 {\raisebox{1.4ex
}[1ex
][0pt
]{\tiny\sffamily\mdseries\makebox[0pt
][l
]{\hspace{.8em
}var
}}\lowercase{#1}}}}}
268 \newcommand{\CNS}[1]{\text{{\sffamily\bfseries\selectfont%
269 {\raisebox{1.4ex
}[1ex
][0pt
]{\tiny\sffamily\mdseries\makebox[0pt
][l
]{\hspace{.5em
}co
}}\lowercase{#1}}}}}
271 \newcommand{\LKWD}[1]{\text{{\sffamily\bfseries\selectfont%
272 {\raisebox{1.4ex
}[1ex
][0pt
]{\tiny\sffamily\mdseries\makebox[0pt
][l
]{\hspace{.5em
}}}\lowercase{#1}}}}}
274 % Return values, First, Second, nth, Third
275 \newcommand{\retval}[1]{\uline{#1}}
276 \newcommand{\retvalii}[1]{\uuline{#1}}
277 \newcommand{\retvaln}[2]{{%
278 {\raisebox{-
1.7ex
}[1ex
][0pt
]{\tiny\sffamily\upshape\mdseries\makebox[0pt
][l
]{\hspace{-
.1em
}#1}}\uline{#2}}}}
279 \newcommand{\retvaliii}[1]{\retvaln{3}{#1}}
282 \newcommand{\T}{\text{\ttfamily T
}}
283 \newcommand{\NIL}{\text{\ttfamily NIL
}}
285 \newcommand{\TLD}{{\textasciitilde}}
287 % Starred versions send argument into index:
288 \WithSuffix\newcommand\kwd*
[1]{\kwd{#1}\uppercase{\index{#1}}}
289 \WithSuffix\newcommand\KWD*
[1]{\KWD{#1}\uppercase{\index{#1}}}
290 \WithSuffix\newcommand\MC*
[1]{\MC{#1}\uppercase{\index{#1}}}
291 \WithSuffix\newcommand\SO*
[1]{\SO{#1}\uppercase{\index{#1}}}
292 \WithSuffix\newcommand\FU*
[1]{\FU{#1}\uppercase{\index{#1}}}
293 \WithSuffix\newcommand\GFU*
[1]{\GFU{#1}\uppercase{\index{#1}}}
294 \WithSuffix\newcommand\V*
[1]{\V{#1}\uppercase{\index{#1}}}
295 \WithSuffix\newcommand\CNS*
[1]{\CNS{#1}\uppercase{\index{#1}}}
296 \WithSuffix\newcommand\LKWD*
[1]{\LKWD{#1}\uppercase{\index{#1}}}
300 \newlength{\titlepagewidth}
301 \setlength{\titlepagewidth}{8cm
}
302 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
304 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
306 \renewcommand{\rmdefault}{ptm
} %% Always times font on title
309 \begin{minipage
}{\titlepagewidth}
311 \rmfamily\mdseries\itshape\fontsize{20}{0}\selectfont
316 \begin{minipage
}{\titlepagewidth}
318 \rmfamily\mdseries\itshape\fontsize{300}{0}\selectfont%
319 {\color{lightgray
}cl\/
}\\
323 \begin{minipage
}{\titlepagewidth}
324 \rmfamily\mdseries\itshape\fontsize{36}{0}\selectfont
325 \hfill Common\/\\
[2mm
]
326 \rmfamily\mdseries\upshape\fontsize{157}{0}\selectfont
327 \rule[3mm
]{\textwidth}{1.5mm
}\\
329 \rule[15mm
]{5.5cm
}{1.5mm
}\hfill\rule[15mm
]{1.77cm
}{1.5mm
}
331 \begin{minipage
}{\titlepagewidth}
332 \rmfamily\mdseries\upshape\fontsize{14}{0}\selectfont
340 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
341 \section*
{\contentsname}
344 \setlength{\columnsep}{1.5em
}%
349 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
352 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
353 \section*
{Typographic Conventions
}
354 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
358 \IT{\kwd{NAME
},
\FU{NAME
},
\MC{NAME
},
\SO{NAME
},
\GFU{NAME
},
\V{*name*
},
361 Symbol defined in Common Lisp; esp.\ function, macro, special operator, generic function,
365 \IT{\VAR{them
}\qquad\qquad\qquad}
367 Placeholder for actual code.
370 \IT{\LIT{me
}\qquad\qquad\qquad\qquad}
372 Text to input literally, or output literally.
375 \IT{\Op{\VAR{foo
}\DF{\LIT{bar
}}}\qquad\qquad}
377 Either one
\VAR{foo
} or nothing; defaults to
\LIT{bar
}.
380 \IT{\OPn{\VAR{foo
}};
\Goos{\VAR{foo
}}}
382 Zero or more
\VAR{foo
}s.
385 \IT{\RP{\VAR{foo
}};
\Goop{\VAR{foo
}}}
387 One or more
\VAR{foo
}s.
390 \IT{\VAR{foos
}\qquad\qquad\qquad}
392 English plural denotes a list argument.
395 \IT{\Goo{\VAR{foo
}\XOR\VAR{bar
}\XOR\VAR{baz
}};
402 Either
\VAR{foo
}, or
\VAR{bar
}, or
\VAR{baz
}.
411 Anything from none to each of
\VAR{foo
},
\VAR{bar
}, and
\VAR{baz
}.
414 \IT{\NEV{\VAR{bar
}}\qquad\qquad\qquad}
416 \VAR{bar
} is not evaluated.
419 \IT{\retval{\VAR{foo
}};
\retvalii{\VAR{bar
}};
420 \retvaln{\VAR{n
}}{\VAR{baz
}}}
422 First, second and
\VAR{n
}th return value.
425 \IT{\T\qquad\qquad\qquad\qquad}
427 \kwd*
{T
}, or truth in general.
430 \IT{\NIL\qquad\qquad\qquad}
432 \kwd*
{NIL
} or
\kwd{()
}.
437 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
438 %%% Content starts here %%%%%%%%%%%%%%%%%%%%%%%%%%
439 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
442 \input{clqr-characters
}
446 \input{clqr-sequences
}
447 \input{clqr-hash-tables
}
448 \input{clqr-structures
}
449 \input{clqr-control-structure
}
451 \input{clqr-conditions-and-errors
}
452 \input{clqr-input-output
}
453 \input{clqr-system-types-and-classes
}
454 \input{clqr-packages-and-symbols
}
455 \input{clqr-compiler
}
456 \input{clqr-environment
}
460 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
461 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
462 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
464 \clearpage % Uncomment/comment this line to save/waste some space
466 \renewcommand{\indexpagestyle}{lispref
}
467 \renewenvironment{theindex
}%
469 {\setlength{\itemindent}{-
1em
}\setlength{\leftmargin}{1em
}}%
470 \parskip0pt plus
.1pt
\itemsep0pt%
471 \raggedright\looseness=-
1%
475 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
476 [\section*
{Index
}\vspace{-
5ex
}]
477 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
478 % Stock \printindex won't do as we want more than two columns.
479 \tiny\sffamily\input{clqr.ind
}
483 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
484 % Make (total) page count a multiple of four.
485 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
488 \newcount\currentpage
489 \currentpage=
\value{page
}
490 \divide\currentpage by
4
491 \multiply\currentpage by
4
492 \advance\currentpage by -
\value{page
}
493 \ifthenelse{\equal{\the\currentpage}{-
3}}{\rule{0pt
}{0pt
}\clearpage}{}
494 \ifthenelse{\equal{\the\currentpage}{-
2}}{\rule{0pt
}{0pt
}\clearpage\rule{0pt
}{0pt
}\clearpage}{}
495 \ifthenelse{\equal{\the\currentpage}{-
1}}{\rule{0pt
}{0pt
}\clearpage\rule{0pt
}{0pt
}\clearpage\rule{0pt
}{0pt
}\clearpage}{}
497 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
499 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
502 \renewcommand{\rmdefault}{ptm
} %% Always times font on title
505 \begin{minipage
}{\titlepagewidth}
507 \rmfamily\mdseries\itshape\fontsize{300}{0}\selectfont
508 \reflectbox{{\color{lightgray
}cl\/
}}\\
512 \vspace*
{43mm
}% Adjust here if text below changes
513 \begin{minipage
}{\titlepagewidth}
517 \makebox[\textwidth][l
]{\maintitle\
\hfill Revision
\input{REVISION
}
518 [\input{DATE
}\hspace{-
.65ex
}]}
519 \makebox[\textwidth][l
]{Copyright
\copyright\
2008 \AUTHOR\hfill\LaTeX\ source:
520 \href{http://clqr.berlios.de
}{http://clqr.berlios.de
}}\\
[1.5mm
]
521 Permission is granted to copy, distribute and/or modify this
522 document under the terms of the GNU Free Documentation License,
523 Version
1.2 or any later version published by the Free Software
524 Foundation; with no Invariant Sections, no Front-Cover Texts and
525 no Back-Cover Texts.
\hfill
526 \href{http://www.gnu.org/licenses/fdl.html
}{http://www.gnu.org/licenses/fdl.html
}\\