Fix fresh-line description
[clqr.git] / clqr-structures.tex
blobe11dfb54e44f3f93104d5bdd60212046f2f2bee4
1 % Copyright (C) 2008, 2009, 2010, 2012, 2014 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; with no Invariant Sections, no Front-Cover Texts and
6 % no Back-Cover Texts. For details see file COPYING.
9 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10 \section{Structures}
11 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13 \begin{LIST}{1cm}
15 \IT{(\MC*{DEFSTRUCT}
16 \xorGOO{\VAR{foo}\\
17 (\VAR{foo\hspace{.5ex}}
18 \orGOO{%
19 \xorGOO{%
20 \kwd{:conc-name}\\
21 (\kwd{:conc-name } \Op{\NEV{\VAR{slot-prefix}}\DF{\VAR{foo}\LIT{-}}})}{.}\\
22 \xorGOO{%
23 \kwd{:constructor}\\
24 (\kwd{:constructor }
25 \OP{\NEV{\VAR{maker}}\DF{\LIT{MAKE-}\VAR{foo}}\text{ }
26 \Op{({\OPn{\NEV{\VAR{ord-$\lambda$}}}})}})}{\}^{\!\!*}}\\
27 \xorGOO{%
28 \kwd{:copier}\\
29 (\kwd{:copier }
30 \Op{\NEV{\VAR{copier}}\DF{\LIT{COPY-}\VAR{foo}}})}{.}\\
31 (\kwd{:include\hspace{.5ex}} \NEV{\VAR{struct}}% disabled to save space %\text{ }
32 \xorGOO{%
33 \NEV{\VAR{slot}}\\
34 (\NEV{\VAR{slot}}\text{\hspace{.5ex}} \Op{\VAR{init}% disabled to save space %\text{ }
35 \orGOO{
36 \kwd{:type\hspace{.5ex}} \NEV{\VAR{sl-type}}\\
37 \kwd{:read-only } \NEV{\VAR{b}}}{\}}})\\
38 }{\}^{\!\!*}})\\
39 \xorGOO{
40 (\kwd{:type } \xorGOO{\kwd{list}\\
41 \kwd{vector}\\
42 (\kwd{vector }\NEV{\VAR{type}})}{\}})\text{ }
43 \orGOO{%
44 \kwd{:named}\\
45 (\kwd{:initial-offset } \NEV{\VAR{n}})\\
46 }{.}\\
47 \xorGOO{
48 (\kwd{:print-object } \Op{\NEV{\VAR{o-printer}}})\\
49 (\kwd{:print-function } \Op{\NEV{\VAR{f-printer}}})
50 }{.}
51 }{.}\\
52 \xorGOO{%
53 \kwd{:predicate}\\
54 (\kwd{:predicate } \Op{\NEV{\VAR{p-name}}\DF{\VAR{foo}\LIT{-P}}})}{.}
55 }{\}}%
57 }{\}}
58 \Op{\NEV{\VAR{doc}}}
59 \xorGOO{
60 \VAR{slot}\\
61 (\VAR{slot } \Op{\VAR{init}\text{ }
62 \orGOO{
63 \kwd{:type } \NEV{\VAR{slot-type}}\\
64 \kwd{:read-only } \NEV{\VAR{bool}}
65 }{\}}})
66 }{\}^{\!\!*}}%
69 Define structure \retval{\VAR{foo}} together with functions
70 \LIT{MAKE-}\VAR{foo}, \LIT{COPY-}\VAR{foo} and
71 \VAR{foo}\LIT{-P}; and \kwd{setf}able accessors
72 \VAR{foo}\LIT{-}\VAR{slot}. Instances are of class \VAR{foo} or, if
73 \kwd{defstruct} option \kwd{:type} is given, of the specified type.
74 They can be
75 created by (\LIT{MAKE-}\VAR{foo} \Goos{\kwd{:}\VAR{slot}
76 \VAR{value}}) or, if \VAR{ord-$\lambda$} (see
77 page \pageref{section:Functions}) is given, by (\VAR{maker}
78 \OPn{\VAR{arg}} \Goos{\kwd{:}\VAR{key} \VAR{value}}). In the latter
79 case, \VAR{arg}s and \kwd{:}\VAR{key}s correspond to the positional
80 and keyword parameters defined in \VAR{ord-$\lambda$} whose
81 \VAR{var}s in turn correspond to \VAR{slot}s.
82 \kwd{:print-object}/\kwd{:print-function} generate a
83 \GFU{print-object} method for an instance \VAR{bar} of \VAR{foo}
84 calling (\VAR{o-printer} \VAR{bar} \VAR{stream}) or (\VAR{f-printer}
85 \VAR{bar} \VAR{stream} \VAR{print-level}), respectively.
86 If \kwd{:type} without \kwd{:named} is given, no \VAR{foo}\LIT{-P}
87 is created.
90 \IT{(\FU*{COPY-STRUCTURE} \VAR{structure})}
92 Return \retval{copy of \VAR{structure}} with shared slot values.
95 \end{LIST}
99 %%% Local Variables:
100 %%% mode: latex
101 %%% TeX-master: "clqr"
102 %%% End: