3 %%% Translation-time metaobjects
5 %%% (c) 2015 Straylight/Edgeware
8 %%%----- Licensing notice ---------------------------------------------------
10 %%% This file is part of the Sensible Object Design, an object system for C.
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.
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.
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.
26 \chapter{Translation-time metaobjects
} \label{ch:meta
}
28 %%%--------------------------------------------------------------------------
29 \section{Base metaobject classes
} \label{sec:meta.classes
}
33 \&key \=:name :nick :location :pset \+\\
34 :superclasses :link :metaclass \\
35 :slots :instance-initializers :class-initializers \\
36 :initargs :initfrags :tearfrags \\
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>
}
52 \dhead{gf
}{sod-class-initargs @<class> @> @<list>
}
53 \dhead{gf
}{setf (sod-class-initargs @<class>) @<list>
}
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>
}
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>
}}
65 {make-sod-class @<name> @<superclasses> @<pset> \&key :location
70 {find-superclass-by-nick @<class> @<nick> @> @<superclass>
}
73 \begin{describe
}{ty
}{inheritance-path-reporter-state
}
76 \begin{describe
}{fun
}{make-inheritance-path-reporter-state @> @<state>
}
79 \begin{describe
}{fun
}{report-inheritance-path @<state> @<super>
}
83 {select-minimal-class-property
84 \=@<supers> @<key> @<order> @<default> @<what> \\
85 \>\&key :present :allow-empty
89 \begin{describe
}{gf
}{guess-metaclass @<class> @> @<metaclass>
}
93 {sod-subclass-p @<class-a> @<class-b> @> @<generalized-boolean>
}
96 \begin{describe
}{fun
}{valid-name-p @<name> @> @<generalized-boolean>
}
99 \begin{describe
}{fun
}{find-root-superclass @<class> @> @<superclass>
}
102 \begin{describe
}{fun
}{find-root-metaclass @<class> @> @<metaclass>
}
105 \begin{describe
}{cls
}{sod-slot () \&key :name :location :pset :class :type
}
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>
}}
115 {make-sod-slot @<class> @<name> @<type> @<pset> \&key :location
121 {find-instance-slot-by-name @<class> @<super-nick> @<slot-name>
124 {find-class-slot-by-name @<class> @<super-nick> @<slot-name>
128 \begin{describe
}{cls
}
129 {sod-class-slot (sod-slot) \\
\ind
130 \&key :name :location :pset :class :type
131 :initializer-function :prepare-function
}
135 {\dhead{gf
}{sod-slot-initializer-function @<slot> @> @<function>
}
136 \dhead{gf
}{sod-slot-prepare-function @<slot> @> @<function>
}}
140 {\dhead{cls
}{sod-initializer ()
141 \&key :slot :location :class :value
}
142 \dhead{cls
}{sod-instance-initializer (sod-initializer)
143 \&key :slot :location :class :value
}
144 \dhead{cls
}{sod-class-initializer (sod-initializer)
145 \&key :slot :location :class :value
}}
149 {\dhead{gf
}{sod-initializer-slot @<init> @> @<slot>
}
150 \dhead{gf
}{sod-initializer-value @<init> @> @<fragment>
}}
155 {make-sod-instance-initializer
156 \=@<class> @<nick> @<name> @<value> @<pset> \\
157 \>\&key :inhibit-initargs :location
160 {make-sod-class-initializer
161 \=@<class> @<nick> @<name> @<value> @<pset> \&key :location
166 {make-sod-initializer-using-slot
167 @<class> @<slot> @<init-class> @<value> @<pset> @<floc>
171 \begin{describe
}{cls
}{sod-initarg () \&key :class :location :name :type
}
175 {\dhead{gf
}{sod-initarg-class @<initarg> @> @<class>
}
176 \dhead{gf
}{sod-initarg-name @<initarg> @> @<string>
}
177 \dhead{gf
}{sod-initarg-type @<initarg> @> @<c-type>
}}
180 \begin{describe
}{cls
}
181 {sod-user-initarg (sod-initarg)
182 \&key :class :location :name :type :default
}
186 {make-sod-user-initarg @<class> @<name> @<type> @<pset>
187 \&key :default :location
191 \begin{describe
}{gf
}{sod-initarg-default @<initarg> @> @<default>
}
194 \begin{describe
}{cls
}
195 {sod-slot-initarg (sod-initarg)
196 \&key :class :location :name :type :slot
}
199 \begin{describe
}{gf
}{sod-initarg-slot @<initarg> @> @<slot>
}
203 {make-sod-slot-initarg @<class> @<name> @<nick> @<slot-name> @<pset>
209 {make-sod-slot-initarg-using-slot @<class> @<name> @<slot> @<pset>
215 {\dhead{gf
}{make-sod-class-initfrag @<class> @<frag> @<pset>
217 \dhead{gf
}{make-sod-class-tearfrag @<class> @<frag> @<pset>
221 \begin{describe
}{cls
}{sod-message () \&key :name :location :class :type
}
225 {\dhead{gf
}{sod-message-name @<message> @> @<string>
}
226 \dhead{gf
}{sod-message-class @<message> @> @<class>
}
227 \dhead{gf
}{sod-message-type @<message> @> @<c-type>
}}
231 {make-sod-message @<class> @<name> @<type> @<pset> \&key :location
235 \begin{describe
}{gf
}{check-message-type @<message> @<type>
}
238 \begin{describe
}{fun
}
239 {find-message-by-name @<class> @<super-nick> @<message-name>
243 \begin{describe
}{cls
}
244 {sod-method () \&key :message :location :class :type :body
}
248 {\dhead{gf
}{sod-method-message @<method> @> @<message>
}
249 \dhead{gf
}{sod-method-class @<method> @> @<class>
}
250 \dhead{gf
}{sod-method-type @<method> @> @<c-type>
}
251 \dhead{gf
}{sod-method-body @<method> @> @<fragment-or-nil>
}}
256 \=@<class> @<nick> @<name> @<type> @<body> \+\\
257 @<pset> \&key :location \-
262 {make-sod-method-using-message
263 \=@<message> @<class>
265 @<pset> \&key :location \-
270 {sod-message-method-class @<message> @<class> @<pset> @> @<method-class>
}
273 \begin{describe
}{gf
}{check-method-type @<method> @<message> @<type>
}
276 \begin{describe
}{fun
}
277 {argument-lists-compatible-p @<message-args> @<method-args>
278 @> @<generalized-boolean>
}
281 \begin{describe
}{fun
}{check-method-return-type @<method-type> @<return-type>
}
284 \begin{describe
}{fun
}
285 {check-method-return-type-against-message @<method-type> @<message-type>
}
288 \begin{describe
}{fun
}
289 {check-method-argument-lists @<method-type> @<message-type>
}
292 %%%--------------------------------------------------------------------------
293 \section{Class finalization protocol
} \label{sec:meta.finalization
}
295 \begin{describe
}{mac
}
296 {finalization-error (@<token> @<arg>^*) \\
\ind
302 \begin{describe
}{fun
}{finalization-failed
}
306 {\dhead{gf
}{sod-class-precedence-list @<class> @> @<list>
}
307 \dhead{gf
}{sod-class-type @<class> @> @<c-type>
}
308 \dhead{gf
}{sod-class-chain-head @<class> @> @<class>
}
309 \dhead{gf
}{sod-class-chain @<class> @> @<list>
}
310 \dhead{gf
}{sod-class-chains @<class> @> @<list>
}
311 \dhead{gf
}{sod-class-state @<class> @> @<state>
}}
314 \begin{describe
}{gf
}{compute-cpl @<class> @> @<list>
}
317 \begin{describe
}{fun
}
318 {report-class-list-merge-error @<class> @<lists> @<error>
}
321 \begin{describe
}{fun
}{merge-class-lists @<class> @<lists> @<pick> @> @<list>
}
324 \begin{describe
}{gf
}{compute-chains @<class> @> @<list>
}
327 \begin{describe
}{gf
}{check-class-initializer @<slot> @<class>
}
328 \begin{describe
}{meth
}{effective-slot,sod-class
}
329 {check-class-initializer (@<slot> effective-slot) (@<class> sod-class)
}
331 \begin{describe
}{meth
}{sod-class-effective-slot,sod-class
}
332 {check-class-initializer (@<slot> sod-class-effective-slot)
333 (@<class> sod-class)
}
337 \begin{describe
}{gf
}{check-sod-class @<class>
}
340 \begin{describe
}{gf
}{finalize-sod-class @<class> @> @<generalized-boolean>
}
341 \begin{describe
}{meth
}{sod-class
}
342 {finalize-sod-class (@<class> sod-class)
}
344 \begin{describe
}{ar-meth
}{sod-class
}
345 {finalize-sod-class (@<class> sod-class) @> @<generalized-boolean>
}
349 \begin{describe
}{fun
}{clos-cpl @<class> @> @<list>
}
352 \begin{describe
}{fun
}{dylan-cpl @<class> @> @<list>
}
355 \begin{describe
}{fun
}{c3-cpl @<class> @> @<list>
}
358 \begin{describe
}{fun
}{flavors-cpl @<class> @> @<list>
}
361 \begin{describe
}{fun
}{python-cpl @<class> @> @<list>
}
364 \begin{describe
}{fun
}{l*loops-cpl @<class> @> @<list>
}
367 %%%----- That's all, folks --------------------------------------------------
371 %%% TeX-master: "sod.tex"