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} | |
32 | {sod-class () \\ \ind | |
33 | \&key \=:name :nick :location :pset \+ \\ | |
34 | :superclasses :link :metaclass \\ | |
35 | :slots :instance-initializers :class-initializers \\ | |
a42893dd | 36 | :initfrags :tearfrags :messages :methods} |
756f4928 MW |
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>} | |
a42893dd MW |
51 | \dhead{gf}{sod-class-initfrags @<class> @> @<list>} |
52 | \dhead{gf}{setf (sod-class-initfrags @<class>) @<list>} | |
53 | \dhead{gf}{sod-class-tearfrags @<class> @> @<list>} | |
54 | \dhead{gf}{setf (sod-class-tearfrags @<class>) @<list>} | |
756f4928 MW |
55 | \dhead{gf}{sod-class-messages @<class> @> @<list>} |
56 | \dhead{gf}{setf (sod-class-messages @<class>) @<list>} | |
57 | \dhead{gf}{sod-class-methods @<class> @> @<list>} | |
58 | \dhead{gf}{setf (sod-class-methods @<class>) @<list>}} | |
59 | \end{describe*} | |
60 | ||
756f4928 MW |
61 | \begin{describe}{fun} |
62 | {make-sod-class @<name> @<superclasses> @<pset> \&optional @<floc> | |
63 | @> @<class>} | |
64 | \end{describe} | |
65 | ||
756f4928 MW |
66 | \begin{describe*} |
67 | {\dhead{lmac}{slot @<name> @<type> @{ @<keyword> @<value> @}^*} | |
68 | \dhead{lmac}{instance-initializer @<nick> @<name> | |
69 | @<value-kind> @<value-form> | |
70 | @{ @<keyword> @<value> @}^*} | |
71 | \dhead{lmac}{class-initializer @<nick> @<name> | |
72 | @<value-kind> @<value-form> | |
73 | @{ @<keyword> @<value> @}^*} | |
74 | \dhead{lmac}{message @<name> @<type> @{ @<keyword> @<value> @}^*} | |
75 | \dhead{lmac}{method @<nick> @<name> @<type> @<body> | |
76 | @{ @<keyword> @<value> @}^*}} | |
77 | \end{describe*} | |
78 | ||
79 | \begin{describe}{fun} | |
80 | {find-superclass-by-nick @<class> @<nick> @> @<superclass>} | |
81 | \end{describe} | |
82 | ||
83 | \begin{describe}{fun} | |
84 | {sod-subclass-p @<class-a> @<class-b> @> @<generalized-boolean>} | |
85 | \end{describe} | |
86 | ||
87 | \begin{describe}{fun}{valid-name-p @<name> @> @<generalized-boolean>} | |
88 | \end{describe} | |
89 | ||
90 | \begin{describe}{fun}{find-root-superclass @<class> @> @<superclass>} | |
91 | \end{describe} | |
92 | ||
93 | \begin{describe}{fun}{find-root-metaclass @<class> @> @<metaclass>} | |
94 | \end{describe} | |
95 | ||
96 | \begin{describe}{cls}{sod-slot () \&key :name :location :pset :class :type} | |
97 | \end{describe} | |
98 | ||
99 | \begin{describe*} | |
100 | {\dhead{gf}{sod-slot-name @<slot> @> @<string>} | |
101 | \dhead{gf}{sod-slot-class @<slot> @> @<class>} | |
102 | \dhead{gf}{sod-slot-type @<slot> @> @<c-type>}} | |
103 | \end{describe*} | |
104 | ||
105 | \begin{describe}{gf} | |
106 | {make-sod-slot @<class> @<name> @<type> @<pset> \&optional @<floc> | |
107 | @> @<slot>} | |
108 | \end{describe} | |
109 | ||
110 | \begin{describe*} | |
111 | {\dhead{fun} | |
112 | {find-instance-slot-by-name @<class> @<super-nick> @<slot-name> | |
113 | @> @<slot>} | |
114 | \dhead{fun} | |
115 | {find-class-slot-by-name @<class> @<super-nick> @<slot-name> | |
116 | @> @<slot>}} | |
117 | \end{describe*} | |
118 | ||
119 | \begin{describe}{fun} | |
120 | {find-instance-slot-by-name @<class> @<super-nick> @<slot-name> | |
121 | @> @<slot>} | |
122 | \end{describe} | |
123 | ||
124 | \begin{describe}{cls} | |
125 | {sod-class-slot (sod-slot) \\ \ind | |
126 | \&key :name :location :pset :class :type | |
127 | :initializer-function :prepare-function} | |
128 | \end{describe} | |
129 | ||
130 | \begin{describe*} | |
131 | {\dhead{gf}{sod-slot-initializer-function @<slot> @> @<function>} | |
132 | \dhead{gf}{sod-slot-prepare-function @<slot> @> @<function>}} | |
133 | \end{describe*} | |
134 | ||
135 | \begin{describe*} | |
136 | {\dhead{cls}{sod-initializer () | |
a888e3ac | 137 | \&key :slot :location :class :value} |
756f4928 | 138 | \dhead{cls}{sod-instance-initializer (sod-initializer) |
a888e3ac | 139 | \&key :slot :location :class :value} |
756f4928 | 140 | \dhead{cls}{sod-class-initializer (sod-initializer) |
a888e3ac | 141 | \&key :slot :location :class :value}} |
756f4928 MW |
142 | \end{describe*} |
143 | ||
144 | \begin{describe*} | |
145 | {\dhead{gf}{sod-initializer-slot @<init> @> @<slot>} | |
a888e3ac | 146 | \dhead{gf}{sod-initializer-value @<init> @> @<fragment>}} |
756f4928 MW |
147 | \end{describe*} |
148 | ||
149 | \begin{describe*} | |
150 | {\dhead{gf} | |
a888e3ac MW |
151 | {make-slot-instance-initializer |
152 | \=@<class> @<nick> @<name> @<value> @<pset> \&optional @<floc> | |
756f4928 MW |
153 | \nlret @<init>} |
154 | \dhead{gf} | |
a888e3ac MW |
155 | {make-slot-class-initializer |
156 | \=@<class> @<nick> @<name> @<value> @<pset> \&optional @<floc> | |
756f4928 MW |
157 | \nlret @<init>}} |
158 | \end{describe*} | |
159 | ||
160 | \begin{describe}{gf} | |
a888e3ac MW |
161 | {make-sod-initializer-using-slot |
162 | \=@<class> @<slot> @<init-class> @<value> @<pset> \&optional @<floc> | |
756f4928 MW |
163 | \nlret @<init>} |
164 | \end{describe} | |
165 | ||
a42893dd MW |
166 | \begin{describe*} |
167 | {\dhead{gf}{make-sod-class-initfrag @<class> @<frag> @<pset> | |
168 | \&optional @<floc>} | |
169 | \dhead{gf}{make-sod-class-tearfrag @<class> @<frag> @<pset> | |
170 | \&optional @<floc>}} | |
171 | \end{describe*} | |
172 | ||
756f4928 MW |
173 | \begin{describe}{cls}{sod-message () \&key :name :location :class :type} |
174 | \end{describe} | |
175 | ||
176 | \begin{describe*} | |
177 | {\dhead{gf}{sod-message-name @<message> @> @<string>} | |
178 | \dhead{gf}{sod-message-class @<message> @> @<class>} | |
179 | \dhead{gf}{sod-message-type @<message> @> @<c-type>}} | |
180 | \end{describe*} | |
181 | ||
182 | \begin{describe}{gf} | |
183 | {make-sod-message @<class> @<name> @<type> @<pset> \&optional @<floc> | |
184 | @> @<message>} | |
185 | \end{describe} | |
186 | ||
187 | \begin{describe}{gf}{check-message-type @<message> @<type>} | |
188 | \end{describe} | |
189 | ||
190 | \begin{describe}{fun} | |
191 | {find-message-by-name @<class> @<super-nick> @<message-name> | |
192 | @> @<message>} | |
193 | \end{describe} | |
194 | ||
195 | \begin{describe}{cls} | |
196 | {sod-method () \&key :message :location :class :type :body} | |
197 | \end{describe} | |
198 | ||
199 | \begin{describe*} | |
200 | {\dhead{gf}{sod-method-message @<method> @> @<message>} | |
201 | \dhead{gf}{sod-method-class @<method> @> @<class>} | |
202 | \dhead{gf}{sod-method-type @<method> @> @<c-type>} | |
203 | \dhead{gf}{sod-method-body @<method> @> @<fragment-or-nil>}} | |
204 | \end{describe*} | |
205 | ||
206 | \begin{describe}{gf} | |
207 | {make-sod-method \=@<class> @<nick> @<name> @<type> @<body> \+ \\ | |
208 | @<pset> \&optional @<floc> \- | |
209 | \nlret @<method>} | |
210 | \end{describe} | |
211 | ||
212 | \begin{describe}{gf} | |
213 | {make-sod-method-using-message \=@<message> @<class> | |
214 | @<type> @<body> \+ \\ | |
215 | @<pset> \&optional @<floc> \- | |
216 | \nlret @<method>} | |
217 | \end{describe} | |
218 | ||
219 | \begin{describe}{gf} | |
220 | {sod-message-method-class @<message> @<class> @<pset> @> @<method-class>} | |
221 | \end{describe} | |
222 | ||
223 | \begin{describe}{gf}{check-method-type @<method> @<message> @<type>} | |
224 | \end{describe} | |
225 | ||
226 | \begin{describe}{fun} | |
227 | {argument-lists-compatible-p @<message-args> @<method-args> | |
228 | @> @<generalized-boolean>} | |
229 | \end{describe} | |
230 | ||
b70cb6d8 MW |
231 | \begin{describe}{fun}{check-method-return-type @<method-type> @<return-type>} |
232 | \end{describe} | |
233 | ||
234 | \begin{describe}{fun} | |
235 | {check-method-return-type-against-message @<method-type> @<message-type>} | |
236 | \end{describe} | |
237 | ||
238 | \begin{describe}{fun} | |
239 | {check-method-argument-lists @<method-type> @<message-type>} | |
240 | \end{describe} | |
241 | ||
756f4928 MW |
242 | %%%-------------------------------------------------------------------------- |
243 | \section{Class finalization protocol} \label{sec:meta.finalization} | |
244 | ||
245 | \begin{describe*} | |
246 | {\dhead{gf}{sod-class-precedence-list <class> @> @<list>} | |
247 | \dhead{gf}{sod-class-type @<class> @> @<c-type>} | |
248 | \dhead{gf}{sod-class-chain-head @<class> @> @<class>} | |
249 | \dhead{gf}{sod-class-chain @<class> @> @<list>} | |
250 | \dhead{gf}{sod-class-chains @<class> @> @<list>} | |
251 | \dhead{gf}{sod-class-state @<class> @> @<state>}} | |
252 | \end{describe*} | |
253 | ||
254 | \begin{describe}{gf}{compute-cpl @<class> @> @<list>} | |
255 | \end{describe} | |
256 | ||
257 | \begin{describe}{gf}{compute-chains @<class> @> @<list>} | |
258 | \end{describe} | |
259 | ||
981b6fb6 MW |
260 | \begin{describe}{gf}{guess-metaclass @<class> @> @<metaclass>} |
261 | \end{describe} | |
262 | ||
756f4928 MW |
263 | \begin{describe}{gf}{check-sod-class @<class>} |
264 | \end{describe} | |
265 | ||
266 | \begin{describe}{gf}{finalize-sod-class @<class>} | |
267 | \end{describe} | |
268 | ||
269 | \begin{describe}{fun}{clos-cpl @<class> @> @<list>} | |
270 | \end{describe} | |
271 | ||
272 | \begin{describe}{fun}{dylan-cpl @<class> @> @<list>} | |
273 | \end{describe} | |
274 | ||
275 | \begin{describe}{fun}{c3-cpl @<class> @> @<list>} | |
276 | \end{describe} | |
277 | ||
278 | \begin{describe}{fun}{flavors-cpl @<class> @> @<list>} | |
279 | \end{describe} | |
280 | ||
281 | \begin{describe}{fun}{python-cpl @<class> @> @<list>} | |
282 | \end{describe} | |
283 | ||
284 | \begin{describe}{fun}{l*loops-cpl @<class> @> @<list>} | |
285 | \end{describe} | |
31d4431b | 286 | |
756f4928 MW |
287 | %%%----- That's all, folks -------------------------------------------------- |
288 | ||
289 | %%% Local variables: | |
290 | %%% mode: LaTeX | |
291 | %%% TeX-master: "sod.tex" | |
292 | %%% TeX-PDF-mode: t | |
293 | %%% End: |