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 \\ | |
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 | ||
756f4928 MW |
57 | \begin{describe}{fun} |
58 | {make-sod-class @<name> @<superclasses> @<pset> \&optional @<floc> | |
59 | @> @<class>} | |
60 | \end{describe} | |
61 | ||
756f4928 MW |
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-kind :value-form} | |
134 | \dhead{cls}{sod-instance-initializer (sod-initializer) | |
135 | \&key :slot :location :class :value-kind :value-form} | |
136 | \dhead{cls}{sod-class-initializer (sod-initializer) | |
137 | \&key :slot :location :class :value-kind :value-form}} | |
138 | \end{describe*} | |
139 | ||
140 | \begin{describe*} | |
141 | {\dhead{gf}{sod-initializer-slot @<init> @> @<slot>} | |
142 | \dhead{gf}{sod-initializer-value-kind @<init> @> @<kind>} | |
143 | \dhead{gf}{sod-initializer-value-form @<init> @> @<fragment>}} | |
144 | \end{describe*} | |
145 | ||
146 | \begin{describe*} | |
147 | {\dhead{gf} | |
148 | {make-slot-instance-initializer \=@<class> @<nick> @<name> | |
149 | @<value-kind> @<value-form> \+ \\ | |
150 | @<pset> \&optional @<floc> \- | |
151 | \nlret @<init>} | |
152 | \dhead{gf} | |
153 | {make-slot-class-initializer \=@<class> @<nick> @<name> | |
154 | @<value-kind> @<value-form> \+ \\ | |
155 | @<pset> \&optional @<floc> \- | |
156 | \nlret @<init>}} | |
157 | \end{describe*} | |
158 | ||
159 | \begin{describe}{gf} | |
160 | {make-sod-initializer-using-slot \=@<class> @<slot> @<init-class> | |
161 | @<value-kind> @<value-form> \+ \\ | |
162 | @<pset> \&optional @<floc> \- | |
163 | \nlret @<init>} | |
164 | \end{describe} | |
165 | ||
166 | \begin{describe}{cls}{sod-message () \&key :name :location :class :type} | |
167 | \end{describe} | |
168 | ||
169 | \begin{describe*} | |
170 | {\dhead{gf}{sod-message-name @<message> @> @<string>} | |
171 | \dhead{gf}{sod-message-class @<message> @> @<class>} | |
172 | \dhead{gf}{sod-message-type @<message> @> @<c-type>}} | |
173 | \end{describe*} | |
174 | ||
175 | \begin{describe}{gf} | |
176 | {make-sod-message @<class> @<name> @<type> @<pset> \&optional @<floc> | |
177 | @> @<message>} | |
178 | \end{describe} | |
179 | ||
180 | \begin{describe}{gf}{check-message-type @<message> @<type>} | |
181 | \end{describe} | |
182 | ||
183 | \begin{describe}{fun} | |
184 | {find-message-by-name @<class> @<super-nick> @<message-name> | |
185 | @> @<message>} | |
186 | \end{describe} | |
187 | ||
188 | \begin{describe}{cls} | |
189 | {sod-method () \&key :message :location :class :type :body} | |
190 | \end{describe} | |
191 | ||
192 | \begin{describe*} | |
193 | {\dhead{gf}{sod-method-message @<method> @> @<message>} | |
194 | \dhead{gf}{sod-method-class @<method> @> @<class>} | |
195 | \dhead{gf}{sod-method-type @<method> @> @<c-type>} | |
196 | \dhead{gf}{sod-method-body @<method> @> @<fragment-or-nil>}} | |
197 | \end{describe*} | |
198 | ||
199 | \begin{describe}{gf} | |
200 | {make-sod-method \=@<class> @<nick> @<name> @<type> @<body> \+ \\ | |
201 | @<pset> \&optional @<floc> \- | |
202 | \nlret @<method>} | |
203 | \end{describe} | |
204 | ||
205 | \begin{describe}{gf} | |
206 | {make-sod-method-using-message \=@<message> @<class> | |
207 | @<type> @<body> \+ \\ | |
208 | @<pset> \&optional @<floc> \- | |
209 | \nlret @<method>} | |
210 | \end{describe} | |
211 | ||
212 | \begin{describe}{gf} | |
213 | {sod-message-method-class @<message> @<class> @<pset> @> @<method-class>} | |
214 | \end{describe} | |
215 | ||
216 | \begin{describe}{gf}{check-method-type @<method> @<message> @<type>} | |
217 | \end{describe} | |
218 | ||
219 | \begin{describe}{fun} | |
220 | {argument-lists-compatible-p @<message-args> @<method-args> | |
221 | @> @<generalized-boolean>} | |
222 | \end{describe} | |
223 | ||
224 | %%%-------------------------------------------------------------------------- | |
225 | \section{Class finalization protocol} \label{sec:meta.finalization} | |
226 | ||
227 | \begin{describe*} | |
228 | {\dhead{gf}{sod-class-precedence-list <class> @> @<list>} | |
229 | \dhead{gf}{sod-class-type @<class> @> @<c-type>} | |
230 | \dhead{gf}{sod-class-chain-head @<class> @> @<class>} | |
231 | \dhead{gf}{sod-class-chain @<class> @> @<list>} | |
232 | \dhead{gf}{sod-class-chains @<class> @> @<list>} | |
233 | \dhead{gf}{sod-class-state @<class> @> @<state>}} | |
234 | \end{describe*} | |
235 | ||
236 | \begin{describe}{gf}{compute-cpl @<class> @> @<list>} | |
237 | \end{describe} | |
238 | ||
239 | \begin{describe}{gf}{compute-chains @<class> @> @<list>} | |
240 | \end{describe} | |
241 | ||
981b6fb6 MW |
242 | \begin{describe}{gf}{guess-metaclass @<class> @> @<metaclass>} |
243 | \end{describe} | |
244 | ||
756f4928 MW |
245 | \begin{describe}{gf}{check-sod-class @<class>} |
246 | \end{describe} | |
247 | ||
248 | \begin{describe}{gf}{finalize-sod-class @<class>} | |
249 | \end{describe} | |
250 | ||
251 | \begin{describe}{fun}{clos-cpl @<class> @> @<list>} | |
252 | \end{describe} | |
253 | ||
254 | \begin{describe}{fun}{dylan-cpl @<class> @> @<list>} | |
255 | \end{describe} | |
256 | ||
257 | \begin{describe}{fun}{c3-cpl @<class> @> @<list>} | |
258 | \end{describe} | |
259 | ||
260 | \begin{describe}{fun}{flavors-cpl @<class> @> @<list>} | |
261 | \end{describe} | |
262 | ||
263 | \begin{describe}{fun}{python-cpl @<class> @> @<list>} | |
264 | \end{describe} | |
265 | ||
266 | \begin{describe}{fun}{l*loops-cpl @<class> @> @<list>} | |
267 | \end{describe} | |
31d4431b | 268 | |
756f4928 MW |
269 | %%%----- That's all, folks -------------------------------------------------- |
270 | ||
271 | %%% Local variables: | |
272 | %%% mode: LaTeX | |
273 | %%% TeX-master: "sod.tex" | |
274 | %%% TeX-PDF-mode: t | |
275 | %%% End: |