Commit | Line | Data |
---|---|---|
756f4928 MW |
1 | %%% -*-latex-*- |
2 | %%% | |
3 | %%% Translation-time metaobjects | |
4 | %%% | |
5 | %%% (c) 2015 Straylight/Edgeware | |
6 | %%% | |
7 | ||
8 | %%%----- Licensing notice --------------------------------------------------- | |
9 | %%% | |
e0808c47 | 10 | %%% This file is part of the Sensible Object Design, an object system for C. |
756f4928 MW |
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} | |
020b9e2b MW |
32 | {sod-class () \\ \ind |
33 | \&key \=:name :nick :location :pset \+\\ | |
34 | :superclasses :link :metaclass \\ | |
756f4928 | 35 | :slots :instance-initializers :class-initializers \\ |
020b9e2b | 36 | :initargs :initfrags :tearfrags \\ |
b2983f35 | 37 | :messages :methods} |
756f4928 MW |
38 | \end{describe} |
39 | ||
40 | \begin{describe*} | |
41 | {\dhead{gf}{sod-class-name @<class> @> @<string>} | |
42 | \dhead{gf}{sod-class-nickname @<class> @> @<string>} | |
43 | \dhead{gf}{sod-class-direct-superclasses @<class> @> @<list>} | |
44 | \dhead{gf}{sod-class-chain-link @<class> @> @<class-or-nil>} | |
45 | \dhead{gf}{sod-class-metaclass @<class> @> @<metaclass>} | |
46 | \dhead{gf}{sod-class-slots @<class> @> @<list>} | |
47 | \dhead{gf}{setf (sod-class-slots @<class>) @<list>} | |
48 | \dhead{gf}{sod-class-instance-initializers @<class> @> @<list>} | |
49 | \dhead{gf}{setf (sod-class-instance-initializers @<class>) @<list>} | |
50 | \dhead{gf}{sod-class-class-initializers @<class> @> @<list>} | |
51 | \dhead{gf}{setf (sod-class-class-initializers @<class>) @<list>} | |
b2983f35 MW |
52 | \dhead{gf}{sod-class-initargs @<class> @> @<list>} |
53 | \dhead{gf}{setf (sod-class-initargs @<class>) @<list>} | |
a42893dd MW |
54 | \dhead{gf}{sod-class-initfrags @<class> @> @<list>} |
55 | \dhead{gf}{setf (sod-class-initfrags @<class>) @<list>} | |
56 | \dhead{gf}{sod-class-tearfrags @<class> @> @<list>} | |
57 | \dhead{gf}{setf (sod-class-tearfrags @<class>) @<list>} | |
756f4928 MW |
58 | \dhead{gf}{sod-class-messages @<class> @> @<list>} |
59 | \dhead{gf}{setf (sod-class-messages @<class>) @<list>} | |
60 | \dhead{gf}{sod-class-methods @<class> @> @<list>} | |
61 | \dhead{gf}{setf (sod-class-methods @<class>) @<list>}} | |
62 | \end{describe*} | |
63 | ||
756f4928 | 64 | \begin{describe}{fun} |
81054f01 | 65 | {make-sod-class @<name> @<superclasses> @<pset> \&key :location |
756f4928 MW |
66 | @> @<class>} |
67 | \end{describe} | |
68 | ||
756f4928 MW |
69 | \begin{describe}{fun} |
70 | {find-superclass-by-nick @<class> @<nick> @> @<superclass>} | |
71 | \end{describe} | |
72 | ||
17c7c784 MW |
73 | \begin{describe}{ty}{inheritance-path-reporter-state} |
74 | \end{describe} | |
75 | ||
76 | \begin{describe}{fun}{make-inheritance-path-reporter-state @> @<state>} | |
77 | \end{describe} | |
78 | ||
79 | \begin{describe}{fun}{report-inheritance-path @<state> @<super>} | |
80 | \end{describe} | |
81 | ||
756f4928 | 82 | \begin{describe}{fun} |
6e92afa7 MW |
83 | {select-minimal-class-property |
84 | \=@<supers> @<key> @<order> @<default> @<what> \\ | |
85 | \>\&key :present :allow-empty | |
86 | \nlret @<object>} | |
87 | \end{describe} | |
88 | ||
73eceea6 MW |
89 | \begin{describe}{gf}{guess-metaclass @<class> @> @<metaclass>} |
90 | \end{describe} | |
91 | ||
6e92afa7 | 92 | \begin{describe}{fun} |
756f4928 MW |
93 | {sod-subclass-p @<class-a> @<class-b> @> @<generalized-boolean>} |
94 | \end{describe} | |
95 | ||
96 | \begin{describe}{fun}{valid-name-p @<name> @> @<generalized-boolean>} | |
97 | \end{describe} | |
98 | ||
99 | \begin{describe}{fun}{find-root-superclass @<class> @> @<superclass>} | |
100 | \end{describe} | |
101 | ||
102 | \begin{describe}{fun}{find-root-metaclass @<class> @> @<metaclass>} | |
103 | \end{describe} | |
104 | ||
105 | \begin{describe}{cls}{sod-slot () \&key :name :location :pset :class :type} | |
106 | \end{describe} | |
107 | ||
108 | \begin{describe*} | |
109 | {\dhead{gf}{sod-slot-name @<slot> @> @<string>} | |
110 | \dhead{gf}{sod-slot-class @<slot> @> @<class>} | |
111 | \dhead{gf}{sod-slot-type @<slot> @> @<c-type>}} | |
112 | \end{describe*} | |
113 | ||
114 | \begin{describe}{gf} | |
81054f01 | 115 | {make-sod-slot @<class> @<name> @<type> @<pset> \&key :location |
756f4928 MW |
116 | @> @<slot>} |
117 | \end{describe} | |
118 | ||
119 | \begin{describe*} | |
120 | {\dhead{fun} | |
121 | {find-instance-slot-by-name @<class> @<super-nick> @<slot-name> | |
122 | @> @<slot>} | |
123 | \dhead{fun} | |
124 | {find-class-slot-by-name @<class> @<super-nick> @<slot-name> | |
125 | @> @<slot>}} | |
126 | \end{describe*} | |
127 | ||
756f4928 | 128 | \begin{describe}{cls} |
020b9e2b | 129 | {sod-class-slot (sod-slot) \\ \ind |
756f4928 MW |
130 | \&key :name :location :pset :class :type |
131 | :initializer-function :prepare-function} | |
132 | \end{describe} | |
133 | ||
134 | \begin{describe*} | |
135 | {\dhead{gf}{sod-slot-initializer-function @<slot> @> @<function>} | |
136 | \dhead{gf}{sod-slot-prepare-function @<slot> @> @<function>}} | |
137 | \end{describe*} | |
138 | ||
139 | \begin{describe*} | |
140 | {\dhead{cls}{sod-initializer () | |
e38e8367 | 141 | \&key :slot :location :class :value} |
756f4928 | 142 | \dhead{cls}{sod-instance-initializer (sod-initializer) |
e38e8367 | 143 | \&key :slot :location :class :value} |
756f4928 | 144 | \dhead{cls}{sod-class-initializer (sod-initializer) |
e38e8367 | 145 | \&key :slot :location :class :value}} |
756f4928 MW |
146 | \end{describe*} |
147 | ||
148 | \begin{describe*} | |
149 | {\dhead{gf}{sod-initializer-slot @<init> @> @<slot>} | |
a75cd932 MW |
150 | \dhead{gf}{sod-initializer-value @<init> @> @<fragment>} |
151 | \dhead{gf}{sod-initializer-class @<init> @> @<class>}} | |
756f4928 MW |
152 | \end{describe*} |
153 | ||
154 | \begin{describe*} | |
155 | {\dhead{gf} | |
1ab17da6 | 156 | {make-sod-instance-initializer |
03570bbb MW |
157 | \=@<class> @<nick> @<name> @<value> @<pset> \\ |
158 | \>\&key :inhibit-initargs :location | |
756f4928 MW |
159 | \nlret @<init>} |
160 | \dhead{gf} | |
1ab17da6 | 161 | {make-sod-class-initializer |
81054f01 | 162 | \=@<class> @<nick> @<name> @<value> @<pset> \&key :location |
756f4928 MW |
163 | \nlret @<init>}} |
164 | \end{describe*} | |
165 | ||
166 | \begin{describe}{gf} | |
a888e3ac | 167 | {make-sod-initializer-using-slot |
81054f01 | 168 | @<class> @<slot> @<init-class> @<value> @<pset> @<floc> |
756f4928 MW |
169 | \nlret @<init>} |
170 | \end{describe} | |
171 | ||
9b9ad6b9 MW |
172 | \begin{describe*} |
173 | {\dhead{cls}{sod-initarg () \&key :class :location :name :type} | |
174 | \dhead{cls}{sod-user-initarg (sod-initarg) | |
175 | \&key :class :location :name :type :default} | |
176 | \dhead{cls}{sod-slot-initarg (sod-initarg) | |
177 | \&key :class :location :name :type :slot}} | |
178 | \end{describe*} | |
b2983f35 MW |
179 | |
180 | \begin{describe*} | |
181 | {\dhead{gf}{sod-initarg-class @<initarg> @> @<class>} | |
182 | \dhead{gf}{sod-initarg-name @<initarg> @> @<string>} | |
9b9ad6b9 MW |
183 | \dhead{gf}{sod-initarg-type @<initarg> @> @<c-type>} |
184 | \dhead{gf}{sod-initarg-default @<initarg> @> @<default>} | |
185 | \dhead{gf}{sod-initarg-slot @<initarg> @> @<slot>}} | |
b2983f35 MW |
186 | \end{describe*} |
187 | ||
a75cd932 MW |
188 | \begin{describe}{gf}{sod-initarg-argument @<initarg> @> @<argument>} |
189 | \end{describe} | |
190 | ||
b2983f35 | 191 | \begin{describe}{gf} |
b871725c MW |
192 | {make-sod-user-initarg @<class> @<name> @<type> @<pset> |
193 | \&key :default :location | |
194 | \nlret @<initarg>} | |
b2983f35 MW |
195 | \end{describe} |
196 | ||
9b9ad6b9 MW |
197 | \begin{describe*} |
198 | {\dhead{gf} | |
199 | {make-sod-slot-initarg @<class> @<name> @<nick> @<slot-name> @<pset> | |
200 | \&key :location | |
201 | \nlret @<initarg>} | |
202 | \dhead{gf} | |
203 | {make-sod-slot-initarg-using-slot @<class> @<name> @<slot> @<pset> | |
204 | \&key :location | |
205 | \nlret @<initarg>}} | |
206 | \end{describe*} | |
b2983f35 | 207 | |
a42893dd MW |
208 | \begin{describe*} |
209 | {\dhead{gf}{make-sod-class-initfrag @<class> @<frag> @<pset> | |
81054f01 | 210 | \&key :location} |
a42893dd | 211 | \dhead{gf}{make-sod-class-tearfrag @<class> @<frag> @<pset> |
81054f01 | 212 | \&key :location}} |
a42893dd MW |
213 | \end{describe*} |
214 | ||
756f4928 MW |
215 | \begin{describe}{cls}{sod-message () \&key :name :location :class :type} |
216 | \end{describe} | |
217 | ||
218 | \begin{describe*} | |
219 | {\dhead{gf}{sod-message-name @<message> @> @<string>} | |
220 | \dhead{gf}{sod-message-class @<message> @> @<class>} | |
221 | \dhead{gf}{sod-message-type @<message> @> @<c-type>}} | |
222 | \end{describe*} | |
223 | ||
224 | \begin{describe}{gf} | |
81054f01 | 225 | {make-sod-message @<class> @<name> @<type> @<pset> \&key :location |
756f4928 MW |
226 | @> @<message>} |
227 | \end{describe} | |
228 | ||
229 | \begin{describe}{gf}{check-message-type @<message> @<type>} | |
230 | \end{describe} | |
231 | ||
232 | \begin{describe}{fun} | |
233 | {find-message-by-name @<class> @<super-nick> @<message-name> | |
234 | @> @<message>} | |
235 | \end{describe} | |
236 | ||
237 | \begin{describe}{cls} | |
238 | {sod-method () \&key :message :location :class :type :body} | |
239 | \end{describe} | |
240 | ||
241 | \begin{describe*} | |
242 | {\dhead{gf}{sod-method-message @<method> @> @<message>} | |
243 | \dhead{gf}{sod-method-class @<method> @> @<class>} | |
244 | \dhead{gf}{sod-method-type @<method> @> @<c-type>} | |
245 | \dhead{gf}{sod-method-body @<method> @> @<fragment-or-nil>}} | |
246 | \end{describe*} | |
247 | ||
248 | \begin{describe}{gf} | |
020b9e2b MW |
249 | {make-sod-method |
250 | \=@<class> @<nick> @<name> @<type> @<body> \+\\ | |
81054f01 | 251 | @<pset> \&key :location \- |
756f4928 MW |
252 | \nlret @<method>} |
253 | \end{describe} | |
254 | ||
255 | \begin{describe}{gf} | |
020b9e2b MW |
256 | {make-sod-method-using-message |
257 | \=@<message> @<class> | |
258 | @<type> @<body> \+\\ | |
81054f01 | 259 | @<pset> \&key :location \- |
756f4928 MW |
260 | \nlret @<method>} |
261 | \end{describe} | |
262 | ||
263 | \begin{describe}{gf} | |
264 | {sod-message-method-class @<message> @<class> @<pset> @> @<method-class>} | |
265 | \end{describe} | |
266 | ||
267 | \begin{describe}{gf}{check-method-type @<method> @<message> @<type>} | |
268 | \end{describe} | |
269 | ||
270 | \begin{describe}{fun} | |
271 | {argument-lists-compatible-p @<message-args> @<method-args> | |
272 | @> @<generalized-boolean>} | |
273 | \end{describe} | |
274 | ||
b70cb6d8 MW |
275 | \begin{describe}{fun}{check-method-return-type @<method-type> @<return-type>} |
276 | \end{describe} | |
277 | ||
278 | \begin{describe}{fun} | |
279 | {check-method-return-type-against-message @<method-type> @<message-type>} | |
280 | \end{describe} | |
281 | ||
282 | \begin{describe}{fun} | |
283 | {check-method-argument-lists @<method-type> @<message-type>} | |
284 | \end{describe} | |
285 | ||
756f4928 MW |
286 | %%%-------------------------------------------------------------------------- |
287 | \section{Class finalization protocol} \label{sec:meta.finalization} | |
288 | ||
e45a106d MW |
289 | \begin{describe}{mac} |
290 | {finalization-error (@<token> @<arg>^*) \\ \ind | |
291 | @<declaration>^* \\ | |
292 | @<form>^* \- | |
293 | \nlret @<value>^*} | |
294 | \end{describe} | |
295 | ||
296 | \begin{describe}{fun}{finalization-failed} | |
297 | \end{describe} | |
298 | ||
756f4928 | 299 | \begin{describe*} |
ba07ddc2 | 300 | {\dhead{gf}{sod-class-precedence-list @<class> @> @<list>} |
756f4928 MW |
301 | \dhead{gf}{sod-class-type @<class> @> @<c-type>} |
302 | \dhead{gf}{sod-class-chain-head @<class> @> @<class>} | |
303 | \dhead{gf}{sod-class-chain @<class> @> @<list>} | |
304 | \dhead{gf}{sod-class-chains @<class> @> @<list>} | |
305 | \dhead{gf}{sod-class-state @<class> @> @<state>}} | |
306 | \end{describe*} | |
307 | ||
308 | \begin{describe}{gf}{compute-cpl @<class> @> @<list>} | |
309 | \end{describe} | |
310 | ||
0dca577d MW |
311 | \begin{describe}{fun} |
312 | {report-class-list-merge-error @<class> @<lists> @<error>} | |
313 | \end{describe} | |
314 | ||
c05ed0f1 | 315 | \begin{describe}{fun}{merge-class-lists @<class> @<lists> @<pick> @> @<list>} |
e2838dc5 MW |
316 | \end{describe} |
317 | ||
756f4928 MW |
318 | \begin{describe}{gf}{compute-chains @<class> @> @<list>} |
319 | \end{describe} | |
320 | ||
2c0aab07 | 321 | \begin{describe}{gf}{check-class-initializer @<slot> @<class>} |
87883222 | 322 | \begin{describe}{meth}{effective-slot,sod-class} |
2c0aab07 MW |
323 | {check-class-initializer (@<slot> effective-slot) (@<class> sod-class)} |
324 | \end{describe} | |
87883222 | 325 | \begin{describe}{meth}{sod-class-effective-slot,sod-class} |
2c0aab07 MW |
326 | {check-class-initializer (@<slot> sod-class-effective-slot) |
327 | (@<class> sod-class)} | |
328 | \end{describe} | |
329 | \end{describe} | |
330 | ||
756f4928 MW |
331 | \begin{describe}{gf}{check-sod-class @<class>} |
332 | \end{describe} | |
333 | ||
e45a106d | 334 | \begin{describe}{gf}{finalize-sod-class @<class> @> @<generalized-boolean>} |
87883222 MW |
335 | \begin{describe}{meth}{sod-class} |
336 | {finalize-sod-class (@<class> sod-class)} | |
32bb097f | 337 | \end{describe} |
87883222 MW |
338 | \begin{describe}{ar-meth}{sod-class} |
339 | {finalize-sod-class (@<class> sod-class) @> @<generalized-boolean>} | |
32bb097f | 340 | \end{describe} |
756f4928 MW |
341 | \end{describe} |
342 | ||
343 | \begin{describe}{fun}{clos-cpl @<class> @> @<list>} | |
344 | \end{describe} | |
345 | ||
346 | \begin{describe}{fun}{dylan-cpl @<class> @> @<list>} | |
347 | \end{describe} | |
348 | ||
349 | \begin{describe}{fun}{c3-cpl @<class> @> @<list>} | |
350 | \end{describe} | |
351 | ||
352 | \begin{describe}{fun}{flavors-cpl @<class> @> @<list>} | |
353 | \end{describe} | |
354 | ||
355 | \begin{describe}{fun}{python-cpl @<class> @> @<list>} | |
356 | \end{describe} | |
357 | ||
358 | \begin{describe}{fun}{l*loops-cpl @<class> @> @<list>} | |
359 | \end{describe} | |
31d4431b | 360 | |
756f4928 MW |
361 | %%%----- That's all, folks -------------------------------------------------- |
362 | ||
363 | %%% Local variables: | |
364 | %%% mode: LaTeX | |
365 | %%% TeX-master: "sod.tex" | |
366 | %%% TeX-PDF-mode: t | |
367 | %%% End: |