html: minor changes
[clqr.git] / clqr-structures.tex
blobe0f6e101b76224adab2ceef8fba29af7ada966b0
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 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11 \section{Structures}
12 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14 \begin{LIST}{1cm}
16 \IT{(\FU*{SLOT-EXISTS-P} \VAR{foo} \VAR{bar})}
18 \retval{\T} if \VAR{foo} has a slot \VAR{bar}.
21 \IT{(\MC*{DEFSTRUCT}
22 \GOO{\VAR{name}\XOR
23 (\VAR{name}
24 \orGOO{%
25 \xorGOO{%
26 \kwd{:conc-name}\\
27 (\kwd{:conc-name } \Op{\VAR{slot-prefix}\DF{\VAR{name}\LIT{-}}})}{.}\\
28 \xorGOO{%
29 \kwd{:constructor}\\
30 (\kwd{:constructor }
31 \OP{\VAR{maker}\DF{\LIT{make-}\VAR{name}}\text{ }
32 \Op{({\OPn{\VAR{arg}}})}})}{\}^{\!\!*}}\\
33 \xorGOO{%
34 \kwd{:copier}\\
35 (\kwd{:copier }
36 \Op{\VAR{copier}\DF{\LIT{copy-}\VAR{name}}})}{.}\\
37 (\kwd{:include} \VAR{ struct}\text{ }
38 \xorGOO{%
39 \VAR{slot}\\
40 (\VAR{slot } \Op{\VAR{init}\text{ }
41 \orGOO{
42 \kwd{:type } \NEV{\VAR{type}}\\
43 \kwd{:read-only } \NEV{\VAR{bool}}}{\}}})\\
44 }{\}^{\!\!*}})\\
45 (\kwd{:type } \xorGOO{\kwd{list}\\
46 \kwd{vector}\\
47 (\kwd{vector}\VAR{ size})}{\}})\text{ }\Op{\kwd{:named}}\\
48 (\kwd{:initial-offset} \VAR{ n})\\
49 \xorGOO{%
50 \kwd{:predicate}\\
51 (\kwd{:predicate } \Op{\VAR{p-name}\DF{\VAR{name}\LIT{-p}}})}{.}\\
52 \xorGOO{
53 (\kwd{:print-object } \Op{\VAR{printer}})\\
54 (\kwd{:print-function } \Op{\VAR{printer}})
55 }{.}%
56 }{\}}%
59 \Op{\NEV{\VAR{doc}}}
60 \xorGOO{
61 \VAR{slot-name}\\
62 (\VAR{slot-name } \Op{\VAR{init}\text{ }
63 \orGOO{
64 \kwd{:type } \NEV{\VAR{type}}\\
65 \kwd{:read-only } \NEV{\VAR{bool}}
66 }{\}}})
67 }{\}^{\!\!*}}%
70 Define structure \retval{\VAR{name}} together with functions
71 \LIT{make-}\VAR{name}, \LIT{copy-}\VAR{name} and
72 \VAR{name}\LIT{-p}; and accessors \VAR{name}\LIT{-}\VAR{slot-name}.
75 \IT{(\FU*{COPY-STRUCTURE} \VAR{structure})}
77 Return \retval{copy of \VAR{structure}} with shared slot values.
80 \end{LIST}