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