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 \\
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>}}
58 {make-sod-class @<name> @<superclasses> @<pset> \&optional @<floc>
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> @}^*}}
76 {find-superclass-by-nick @<class> @<nick> @> @<superclass>}
80 {sod-subclass-p @<class-a> @<class-b> @> @<generalized-boolean>}
83 \begin{describe}{fun}{valid-name-p @<name> @> @<generalized-boolean>}
86 \begin{describe}{fun}{find-root-superclass @<class> @> @<superclass>}
89 \begin{describe}{fun}{find-root-metaclass @<class> @> @<metaclass>}
92 \begin{describe}{cls}{sod-slot () \&key :name :location :pset :class :type}
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>}}
102 {make-sod-slot @<class> @<name> @<type> @<pset> \&optional @<floc>
108 {find-instance-slot-by-name @<class> @<super-nick> @<slot-name>
111 {find-class-slot-by-name @<class> @<super-nick> @<slot-name>
115 \begin{describe}{fun}
116 {find-instance-slot-by-name @<class> @<super-nick> @<slot-name>
120 \begin{describe}{cls}
121 {sod-class-slot (sod-slot) \\ \ind
122 \&key :name :location :pset :class :type
123 :initializer-function :prepare-function}
127 {\dhead{gf}{sod-slot-initializer-function @<slot> @> @<function>}
128 \dhead{gf}{sod-slot-prepare-function @<slot> @> @<function>}}
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}}
141 {\dhead{gf}{sod-initializer-slot @<init> @> @<slot>}
142 \dhead{gf}{sod-initializer-value @<init> @> @<fragment>}}
147 {make-slot-instance-initializer
148 \=@<class> @<nick> @<name> @<value> @<pset> \&optional @<floc>
151 {make-slot-class-initializer
152 \=@<class> @<nick> @<name> @<value> @<pset> \&optional @<floc>
157 {make-sod-initializer-using-slot
158 \=@<class> @<slot> @<init-class> @<value> @<pset> \&optional @<floc>
162 \begin{describe}{cls}{sod-message () \&key :name :location :class :type}
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>}}
172 {make-sod-message @<class> @<name> @<type> @<pset> \&optional @<floc>
176 \begin{describe}{gf}{check-message-type @<message> @<type>}
179 \begin{describe}{fun}
180 {find-message-by-name @<class> @<super-nick> @<message-name>
184 \begin{describe}{cls}
185 {sod-method () \&key :message :location :class :type :body}
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>}}
196 {make-sod-method \=@<class> @<nick> @<name> @<type> @<body> \+ \\
197 @<pset> \&optional @<floc> \-
202 {make-sod-method-using-message \=@<message> @<class>
203 @<type> @<body> \+ \\
204 @<pset> \&optional @<floc> \-
209 {sod-message-method-class @<message> @<class> @<pset> @> @<method-class>}
212 \begin{describe}{gf}{check-method-type @<method> @<message> @<type>}
215 \begin{describe}{fun}
216 {argument-lists-compatible-p @<message-args> @<method-args>
217 @> @<generalized-boolean>}
220 \begin{describe}{fun}{check-method-return-type @<method-type> @<return-type>}
223 \begin{describe}{fun}
224 {check-method-return-type-against-message @<method-type> @<message-type>}
227 \begin{describe}{fun}
228 {check-method-argument-lists @<method-type> @<message-type>}
231 %%%--------------------------------------------------------------------------
232 \section{Class finalization protocol} \label{sec:meta.finalization}
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>}}
243 \begin{describe}{gf}{compute-cpl @<class> @> @<list>}
246 \begin{describe}{gf}{compute-chains @<class> @> @<list>}
249 \begin{describe}{gf}{guess-metaclass @<class> @> @<metaclass>}
252 \begin{describe}{gf}{check-sod-class @<class>}
255 \begin{describe}{gf}{finalize-sod-class @<class>}
258 \begin{describe}{fun}{clos-cpl @<class> @> @<list>}
261 \begin{describe}{fun}{dylan-cpl @<class> @> @<list>}
264 \begin{describe}{fun}{c3-cpl @<class> @> @<list>}
267 \begin{describe}{fun}{flavors-cpl @<class> @> @<list>}
270 \begin{describe}{fun}{python-cpl @<class> @> @<list>}
273 \begin{describe}{fun}{l*loops-cpl @<class> @> @<list>}
276 %%%----- That's all, folks --------------------------------------------------
280 %%% TeX-master: "sod.tex"