doc/: Miscellaneous clarifications and rewordings.
[sod] / doc / meta.tex
1 %%% -*-latex-*-
2 %%%
3 %%% Translation-time metaobjects
4 %%%
5 %%% (c) 2015 Straylight/Edgeware
6 %%%
7
8 %%%----- Licensing notice ---------------------------------------------------
9 %%%
10 %%% This file is part of the Sensible Object Design, an object system for C.
11 %%%
12 %%% SOD is free software; you can redistribute it and/or modify
13 %%% it under the terms of the GNU General Public License as published by
14 %%% the Free Software Foundation; either version 2 of the License, or
15 %%% (at your option) any later version.
16 %%%
17 %%% SOD is distributed in the hope that it will be useful,
18 %%% but WITHOUT ANY WARRANTY; without even the implied warranty of
19 %%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 %%% GNU General Public License for more details.
21 %%%
22 %%% You should have received a copy of the GNU General Public License
23 %%% along with SOD; if not, write to the Free Software Foundation,
24 %%% Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25
26 \chapter{Translation-time metaobjects} \label{ch:meta}
27
28 %%%--------------------------------------------------------------------------
29 \section{Base metaobject classes} \label{sec:meta.classes}
30
31 \begin{describe}{cls}
32 {sod-class () \\ \ind
33 \&key \=:name :nick :location :pset \+ \\
34 :superclasses :link :metaclass \\
35 :slots :instance-initializers :class-initializers \\
36 :messages :methods}
37 \end{describe}
38
39 \begin{describe*}
40 {\dhead{gf}{sod-class-name @<class> @> @<string>}
41 \dhead{gf}{sod-class-nickname @<class> @> @<string>}
42 \dhead{gf}{sod-class-direct-superclasses @<class> @> @<list>}
43 \dhead{gf}{sod-class-chain-link @<class> @> @<class-or-nil>}
44 \dhead{gf}{sod-class-metaclass @<class> @> @<metaclass>}
45 \dhead{gf}{sod-class-slots @<class> @> @<list>}
46 \dhead{gf}{setf (sod-class-slots @<class>) @<list>}
47 \dhead{gf}{sod-class-instance-initializers @<class> @> @<list>}
48 \dhead{gf}{setf (sod-class-instance-initializers @<class>) @<list>}
49 \dhead{gf}{sod-class-class-initializers @<class> @> @<list>}
50 \dhead{gf}{setf (sod-class-class-initializers @<class>) @<list>}
51 \dhead{gf}{sod-class-messages @<class> @> @<list>}
52 \dhead{gf}{setf (sod-class-messages @<class>) @<list>}
53 \dhead{gf}{sod-class-methods @<class> @> @<list>}
54 \dhead{gf}{setf (sod-class-methods @<class>) @<list>}}
55 \end{describe*}
56
57 \begin{describe}{fun}
58 {make-sod-class @<name> @<superclasses> @<pset> \&optional @<floc>
59 @> @<class>}
60 \end{describe}
61
62 \begin{describe*}
63 {\dhead{lmac}{slot @<name> @<type> @{ @<keyword> @<value> @}^*}
64 \dhead{lmac}{instance-initializer @<nick> @<name>
65 @<value-kind> @<value-form>
66 @{ @<keyword> @<value> @}^*}
67 \dhead{lmac}{class-initializer @<nick> @<name>
68 @<value-kind> @<value-form>
69 @{ @<keyword> @<value> @}^*}
70 \dhead{lmac}{message @<name> @<type> @{ @<keyword> @<value> @}^*}
71 \dhead{lmac}{method @<nick> @<name> @<type> @<body>
72 @{ @<keyword> @<value> @}^*}}
73 \end{describe*}
74
75 \begin{describe}{fun}
76 {find-superclass-by-nick @<class> @<nick> @> @<superclass>}
77 \end{describe}
78
79 \begin{describe}{fun}
80 {sod-subclass-p @<class-a> @<class-b> @> @<generalized-boolean>}
81 \end{describe}
82
83 \begin{describe}{fun}{valid-name-p @<name> @> @<generalized-boolean>}
84 \end{describe}
85
86 \begin{describe}{fun}{find-root-superclass @<class> @> @<superclass>}
87 \end{describe}
88
89 \begin{describe}{fun}{find-root-metaclass @<class> @> @<metaclass>}
90 \end{describe}
91
92 \begin{describe}{cls}{sod-slot () \&key :name :location :pset :class :type}
93 \end{describe}
94
95 \begin{describe*}
96 {\dhead{gf}{sod-slot-name @<slot> @> @<string>}
97 \dhead{gf}{sod-slot-class @<slot> @> @<class>}
98 \dhead{gf}{sod-slot-type @<slot> @> @<c-type>}}
99 \end{describe*}
100
101 \begin{describe}{gf}
102 {make-sod-slot @<class> @<name> @<type> @<pset> \&optional @<floc>
103 @> @<slot>}
104 \end{describe}
105
106 \begin{describe*}
107 {\dhead{fun}
108 {find-instance-slot-by-name @<class> @<super-nick> @<slot-name>
109 @> @<slot>}
110 \dhead{fun}
111 {find-class-slot-by-name @<class> @<super-nick> @<slot-name>
112 @> @<slot>}}
113 \end{describe*}
114
115 \begin{describe}{fun}
116 {find-instance-slot-by-name @<class> @<super-nick> @<slot-name>
117 @> @<slot>}
118 \end{describe}
119
120 \begin{describe}{cls}
121 {sod-class-slot (sod-slot) \\ \ind
122 \&key :name :location :pset :class :type
123 :initializer-function :prepare-function}
124 \end{describe}
125
126 \begin{describe*}
127 {\dhead{gf}{sod-slot-initializer-function @<slot> @> @<function>}
128 \dhead{gf}{sod-slot-prepare-function @<slot> @> @<function>}}
129 \end{describe*}
130
131 \begin{describe*}
132 {\dhead{cls}{sod-initializer ()
133 \&key :slot :location :class :value}
134 \dhead{cls}{sod-instance-initializer (sod-initializer)
135 \&key :slot :location :class :value}
136 \dhead{cls}{sod-class-initializer (sod-initializer)
137 \&key :slot :location :class :value}}
138 \end{describe*}
139
140 \begin{describe*}
141 {\dhead{gf}{sod-initializer-slot @<init> @> @<slot>}
142 \dhead{gf}{sod-initializer-value @<init> @> @<fragment>}}
143 \end{describe*}
144
145 \begin{describe*}
146 {\dhead{gf}
147 {make-slot-instance-initializer
148 \=@<class> @<nick> @<name> @<value> @<pset> \&optional @<floc>
149 \nlret @<init>}
150 \dhead{gf}
151 {make-slot-class-initializer
152 \=@<class> @<nick> @<name> @<value> @<pset> \&optional @<floc>
153 \nlret @<init>}}
154 \end{describe*}
155
156 \begin{describe}{gf}
157 {make-sod-initializer-using-slot
158 \=@<class> @<slot> @<init-class> @<value> @<pset> \&optional @<floc>
159 \nlret @<init>}
160 \end{describe}
161
162 \begin{describe}{cls}{sod-message () \&key :name :location :class :type}
163 \end{describe}
164
165 \begin{describe*}
166 {\dhead{gf}{sod-message-name @<message> @> @<string>}
167 \dhead{gf}{sod-message-class @<message> @> @<class>}
168 \dhead{gf}{sod-message-type @<message> @> @<c-type>}}
169 \end{describe*}
170
171 \begin{describe}{gf}
172 {make-sod-message @<class> @<name> @<type> @<pset> \&optional @<floc>
173 @> @<message>}
174 \end{describe}
175
176 \begin{describe}{gf}{check-message-type @<message> @<type>}
177 \end{describe}
178
179 \begin{describe}{fun}
180 {find-message-by-name @<class> @<super-nick> @<message-name>
181 @> @<message>}
182 \end{describe}
183
184 \begin{describe}{cls}
185 {sod-method () \&key :message :location :class :type :body}
186 \end{describe}
187
188 \begin{describe*}
189 {\dhead{gf}{sod-method-message @<method> @> @<message>}
190 \dhead{gf}{sod-method-class @<method> @> @<class>}
191 \dhead{gf}{sod-method-type @<method> @> @<c-type>}
192 \dhead{gf}{sod-method-body @<method> @> @<fragment-or-nil>}}
193 \end{describe*}
194
195 \begin{describe}{gf}
196 {make-sod-method \=@<class> @<nick> @<name> @<type> @<body> \+ \\
197 @<pset> \&optional @<floc> \-
198 \nlret @<method>}
199 \end{describe}
200
201 \begin{describe}{gf}
202 {make-sod-method-using-message \=@<message> @<class>
203 @<type> @<body> \+ \\
204 @<pset> \&optional @<floc> \-
205 \nlret @<method>}
206 \end{describe}
207
208 \begin{describe}{gf}
209 {sod-message-method-class @<message> @<class> @<pset> @> @<method-class>}
210 \end{describe}
211
212 \begin{describe}{gf}{check-method-type @<method> @<message> @<type>}
213 \end{describe}
214
215 \begin{describe}{fun}
216 {argument-lists-compatible-p @<message-args> @<method-args>
217 @> @<generalized-boolean>}
218 \end{describe}
219
220 \begin{describe}{fun}{check-method-return-type @<method-type> @<return-type>}
221 \end{describe}
222
223 \begin{describe}{fun}
224 {check-method-return-type-against-message @<method-type> @<message-type>}
225 \end{describe}
226
227 \begin{describe}{fun}
228 {check-method-argument-lists @<method-type> @<message-type>}
229 \end{describe}
230
231 %%%--------------------------------------------------------------------------
232 \section{Class finalization protocol} \label{sec:meta.finalization}
233
234 \begin{describe*}
235 {\dhead{gf}{sod-class-precedence-list <class> @> @<list>}
236 \dhead{gf}{sod-class-type @<class> @> @<c-type>}
237 \dhead{gf}{sod-class-chain-head @<class> @> @<class>}
238 \dhead{gf}{sod-class-chain @<class> @> @<list>}
239 \dhead{gf}{sod-class-chains @<class> @> @<list>}
240 \dhead{gf}{sod-class-state @<class> @> @<state>}}
241 \end{describe*}
242
243 \begin{describe}{gf}{compute-cpl @<class> @> @<list>}
244 \end{describe}
245
246 \begin{describe}{gf}{compute-chains @<class> @> @<list>}
247 \end{describe}
248
249 \begin{describe}{gf}{guess-metaclass @<class> @> @<metaclass>}
250 \end{describe}
251
252 \begin{describe}{gf}{check-sod-class @<class>}
253 \end{describe}
254
255 \begin{describe}{gf}{finalize-sod-class @<class>}
256 \end{describe}
257
258 \begin{describe}{fun}{clos-cpl @<class> @> @<list>}
259 \end{describe}
260
261 \begin{describe}{fun}{dylan-cpl @<class> @> @<list>}
262 \end{describe}
263
264 \begin{describe}{fun}{c3-cpl @<class> @> @<list>}
265 \end{describe}
266
267 \begin{describe}{fun}{flavors-cpl @<class> @> @<list>}
268 \end{describe}
269
270 \begin{describe}{fun}{python-cpl @<class> @> @<list>}
271 \end{describe}
272
273 \begin{describe}{fun}{l*loops-cpl @<class> @> @<list>}
274 \end{describe}
275
276 %%%----- That's all, folks --------------------------------------------------
277
278 %%% Local variables:
279 %%% mode: LaTeX
280 %%% TeX-master: "sod.tex"
281 %%% TeX-PDF-mode: t
282 %%% End: