author | Jan Vrany <jan.vrany@labware.com> |
Thu, 25 Mar 2021 20:30:03 +0000 | |
branch | jv |
changeset 25411 | 248600ba8fd9 |
parent 23107 | 40173e082cbc |
permissions | -rw-r--r-- |
1 | 1 |
" |
5 | 2 |
COPYRIGHT (c) 1988 by Claus Gittinger |
23107 | 3 |
COPYRIGHT (c) 2009 Jan Vrany |
4 |
COPYRIGHT (c) 2016 Jan Vrany |
|
159 | 5 |
All Rights Reserved |
1 | 6 |
|
7 |
This software is furnished under a license and may be used |
|
8 |
only in accordance with the terms of that license and with the |
|
9 |
inclusion of the above copyright notice. This software may not |
|
10 |
be provided or otherwise made available to, or used by, any |
|
11 |
other person. No title to or ownership of the software is |
|
12 |
hereby transferred. |
|
13 |
" |
|
5341
e7465ebd9126
change notification for new classes
Claus Gittinger <cg@exept.de>
parents:
5328
diff
changeset
|
14 |
"{ Package: 'stx:libbasic' }" |
e7465ebd9126
change notification for new classes
Claus Gittinger <cg@exept.de>
parents:
5328
diff
changeset
|
15 |
|
17277 | 16 |
"{ NameSpace: Smalltalk }" |
17 |
||
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
18 |
ClassDescription subclass:#Metaclass |
1047 | 19 |
instanceVariableNames:'myClass' |
2822
64829ed8f8c6
allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
20 |
classVariableNames:'ConfirmationQuerySignal' |
1047 | 21 |
poolDictionaries:'' |
22 |
category:'Kernel-Classes' |
|
1 | 23 |
! |
24 |
||
1742 | 25 |
!Metaclass class methodsFor:'documentation'! |
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
26 |
|
88 | 27 |
copyright |
28 |
" |
|
29 |
COPYRIGHT (c) 1988 by Claus Gittinger |
|
23107 | 30 |
COPYRIGHT (c) 2009 Jan Vrany |
31 |
COPYRIGHT (c) 2016 Jan Vrany |
|
159 | 32 |
All Rights Reserved |
1 | 33 |
|
88 | 34 |
This software is furnished under a license and may be used |
35 |
only in accordance with the terms of that license and with the |
|
36 |
inclusion of the above copyright notice. This software may not |
|
37 |
be provided or otherwise made available to, or used by, any |
|
38 |
other person. No title to or ownership of the software is |
|
39 |
hereby transferred. |
|
40 |
" |
|
621 | 41 |
! |
42 |
||
43 |
documentation |
|
44 |
" |
|
45 |
every classes class is a subclass of Metaclass. |
|
46 |
(i.e. every class is the sole instance of its Metaclass) |
|
12094 | 47 |
Metaclass provides support for creating new (sub)classes and/or |
621 | 48 |
changing the definition of an already existing class. |
1292 | 49 |
|
50 |
[author:] |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
51 |
Claus Gittinger |
1669 | 52 |
|
53 |
[see also:] |
|
54 |
Behavior ClassDescription Class |
|
621 | 55 |
" |
88 | 56 |
! ! |
1 | 57 |
|
2822
64829ed8f8c6
allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
58 |
!Metaclass class methodsFor:'Signal constants'! |
64829ed8f8c6
allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
59 |
|
64829ed8f8c6
allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
60 |
confirmationQuerySignal |
64829ed8f8c6
allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
61 |
"return the query signal which is raised to ask if user |
64829ed8f8c6
allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
62 |
confirmation dialogs should be opened. |
64829ed8f8c6
allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
63 |
If unhandled, they are." |
64829ed8f8c6
allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
64 |
|
64829ed8f8c6
allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
65 |
^ ConfirmationQuerySignal |
64829ed8f8c6
allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
66 |
|
64829ed8f8c6
allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
67 |
"Created: 31.7.1997 / 21:55:39 / cg" |
64829ed8f8c6
allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
68 |
! ! |
64829ed8f8c6
allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
69 |
|
64829ed8f8c6
allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
70 |
!Metaclass class methodsFor:'class initialization'! |
64829ed8f8c6
allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
71 |
|
64829ed8f8c6
allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
72 |
initialize |
12254 | 73 |
ConfirmationQuerySignal isNil ifTrue:[ |
74 |
ConfirmationQuerySignal := Query newSignal defaultAnswer:true. |
|
75 |
]. |
|
2822
64829ed8f8c6
allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
76 |
|
64829ed8f8c6
allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
77 |
"Modified: 31.7.1997 / 21:54:44 / cg" |
64829ed8f8c6
allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
78 |
! ! |
64829ed8f8c6
allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
79 |
|
1742 | 80 |
!Metaclass class methodsFor:'creating metaclasses'! |
356 | 81 |
|
82 |
new |
|
83 |
"creating a new metaclass - have to set the new classes |
|
84 |
flags correctly to have it behave like a metaclass ... |
|
85 |
Not for normal applications - creating new metaclasses is a very |
|
86 |
tricky thing; should be left to the gurus ;-)" |
|
87 |
||
88 |
|newMetaclass| |
|
89 |
||
90 |
newMetaclass := super new. |
|
91 |
newMetaclass instSize:(Class instSize). |
|
92 |
newMetaclass setSuperclass:Class. |
|
93 |
||
94 |
^ newMetaclass |
|
95 |
||
96 |
" |
|
97 |
Metaclass new <- new metaclass |
|
98 |
Metaclass new new <- new class |
|
99 |
Metaclass new new new <- new instance |
|
100 |
" |
|
101 |
! ! |
|
102 |
||
1742 | 103 |
!Metaclass class methodsFor:'queries'! |
1179
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1087
diff
changeset
|
104 |
|
7617 | 105 |
asPrivate |
12094 | 106 |
^ PrivateMetaclass |
7617 | 107 |
! |
108 |
||
1179
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1087
diff
changeset
|
109 |
isBuiltInClass |
1266 | 110 |
"return true if this class is known by the run-time-system. |
111 |
Here, true is returned for myself, false for subclasses." |
|
112 |
||
1179
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1087
diff
changeset
|
113 |
^ self == Metaclass class or:[self == Metaclass] |
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1087
diff
changeset
|
114 |
|
1266 | 115 |
"Modified: 23.4.1996 / 15:59:44 / cg" |
1179
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1087
diff
changeset
|
116 |
! ! |
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1087
diff
changeset
|
117 |
|
7261 | 118 |
!Metaclass methodsFor:'Compatibility-ST80'! |
3012 | 119 |
|
120 |
comment:aString |
|
121 |
"ignored - sometimes found in ST-80 fileOut files. |
|
122 |
Comments are supposed to be defined via class messages." |
|
123 |
||
124 |
"Created: 9.10.1997 / 18:14:34 / cg" |
|
3079 | 125 |
! |
126 |
||
127 |
sourceCodeTemplate |
|
128 |
"ST80 compatibility - return a definition message for myself. |
|
129 |
Same as #definition" |
|
130 |
||
131 |
^ self soleInstance definition |
|
132 |
||
133 |
"Created: / 1.11.1997 / 13:16:45 / cg" |
|
3012 | 134 |
! ! |
135 |
||
19243
b2e7db65ed4b
Added Metaclass>>dllPath
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
136 |
|
5578 | 137 |
!Metaclass methodsFor:'autoload check'! |
138 |
||
139 |
isLoaded |
|
12094 | 140 |
"return true, if the class has been loaded; |
5578 | 141 |
redefined in Autoload; see comment there" |
142 |
||
14647 | 143 |
^ myClass isNil or:[ myClass isLoaded ] |
5578 | 144 |
|
145 |
||
146 |
! ! |
|
147 |
||
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
148 |
!Metaclass methodsFor:'class instance variables'! |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
149 |
|
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
150 |
instanceVariableNames:aString |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
151 |
"changing / adding class-inst vars - |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
152 |
this actually creates a new metaclass and class, leaving the original |
16769 | 153 |
class hanging around as obsolete classes. |
154 |
This may also be true for all subclasses, if class instance variables are added/removed in a superclass. |
|
155 |
Existing instances (i.e. insts of the class) are migrated to become instances of the new class(es). |
|
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
156 |
|
16769 | 157 |
However, if the old class is referenced somewhere (in a collection), |
158 |
that reference will still point to the old, now obsolete class. |
|
159 |
Time will show, if that is a problem and will be fixed." |
|
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
160 |
|
6021 | 161 |
|builder| |
162 |
||
7518
298576c9de5a
care for no real change in instanceVariableString.
Claus Gittinger <cg@exept.de>
parents:
7435
diff
changeset
|
163 |
self instanceVariableString asStringCollection = aString asStringCollection ifTrue:[^ self]. |
298576c9de5a
care for no real change in instanceVariableString.
Claus Gittinger <cg@exept.de>
parents:
7435
diff
changeset
|
164 |
|
6021 | 165 |
builder := ClassBuilder new. |
166 |
builder oldMetaclass:self instanceVariableNames:aString. |
|
16769 | 167 |
builder rebuildForChangedClassInstanceVariables. |
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
168 |
! ! |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
169 |
|
5994
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
170 |
!Metaclass methodsFor:'compiler interface'! |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
171 |
|
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
172 |
browserClass |
12094 | 173 |
"return the browser to use for this class - |
5994
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
174 |
this can be redefined in special classes, to get different browsers" |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
175 |
|
6021 | 176 |
^ UserPreferences systemBrowserClass. |
5994
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
177 |
|
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
178 |
"Created: 3.5.1996 / 12:36:40 / cg" |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
179 |
! |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
180 |
|
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
181 |
compilerClass |
12094 | 182 |
"return the compiler to use for this class - |
5994
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
183 |
this can be redefined in special classes, to compile classes with |
17678 | 184 |
JavaScript, Ruby, Lisp, Prolog, ASN1, Basic :-) or whatever syntax." |
5994
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
185 |
|
12149
797e3911c35d
added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents:
12102
diff
changeset
|
186 |
^ self programmingLanguage compilerClass. |
12102 | 187 |
|
188 |
" |
|
189 |
Array compilerClass |
|
190 |
" |
|
5994
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
191 |
! |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
192 |
|
19243
b2e7db65ed4b
Added Metaclass>>dllPath
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
193 |
dllPath |
b2e7db65ed4b
Added Metaclass>>dllPath
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
194 |
^ myClass dllPath |
b2e7db65ed4b
Added Metaclass>>dllPath
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
195 |
|
b2e7db65ed4b
Added Metaclass>>dllPath
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
196 |
"Created: / 19-02-2016 / 14:08:59 / jv" |
b2e7db65ed4b
Added Metaclass>>dllPath
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
197 |
! |
b2e7db65ed4b
Added Metaclass>>dllPath
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
198 |
|
5994
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
199 |
evaluatorClass |
12094 | 200 |
"return the compiler to use for expression evaluation for this class - |
5994
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
201 |
this can be redefined in special classes, to evaluate expressions with |
17678 | 202 |
JavaScript, Ruby, Lisp, Prolog, ASN1, Basic :-) or whatever syntax." |
5994
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
203 |
|
12149
797e3911c35d
added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents:
12102
diff
changeset
|
204 |
^ self programmingLanguage evaluatorClass. |
12102 | 205 |
|
206 |
" |
|
207 |
Array evaluatorClass |
|
208 |
" |
|
5994
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
209 |
! |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
210 |
|
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
211 |
formatterClass |
12094 | 212 |
"return the parser to use for formatting (prettyPrinting) this class - |
5994
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
213 |
this can be redefined in special classes, to format classes with |
17678 | 214 |
JavaScript, Ruby, Lisp, Prolog, ASN1, Basic :-) or whatever syntax." |
5994
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
215 |
|
12149
797e3911c35d
added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents:
12102
diff
changeset
|
216 |
^ self programmingLanguage formatterClass. |
5994
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
217 |
|
12102 | 218 |
" |
219 |
Array formatterClass |
|
220 |
" |
|
5994
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
221 |
! |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
222 |
|
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
223 |
parserClass |
12094 | 224 |
"return the parser to use for parsing this class - |
5994
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
225 |
this can be redefined in special classes, to parse classes with |
17678 | 226 |
JavaScript, Ruby, Lisp, Prolog, ASN1, Basic :-) or whatever syntax." |
5994
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
227 |
|
12149
797e3911c35d
added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents:
12102
diff
changeset
|
228 |
^ self programmingLanguage parserClass. |
5994
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
229 |
|
12102 | 230 |
" |
231 |
Array parserClass |
|
232 |
" |
|
5994
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
233 |
! |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
234 |
|
12149
797e3911c35d
added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents:
12102
diff
changeset
|
235 |
programmingLanguage |
797e3911c35d
added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents:
12102
diff
changeset
|
236 |
"return the programming language in which this class is written" |
797e3911c35d
added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents:
12102
diff
changeset
|
237 |
|
797e3911c35d
added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents:
12102
diff
changeset
|
238 |
^ SmalltalkLanguage instance |
797e3911c35d
added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents:
12102
diff
changeset
|
239 |
|
797e3911c35d
added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents:
12102
diff
changeset
|
240 |
"Created: / 15-08-2009 / 09:06:25 / Jan Vrany <vranyj1@fel.cvut.cz>" |
797e3911c35d
added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents:
12102
diff
changeset
|
241 |
"Modified: / 16-08-2009 / 10:37:08 / Jan Vrany <vranyj1@fel.cvut.cz>" |
797e3911c35d
added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents:
12102
diff
changeset
|
242 |
! |
797e3911c35d
added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents:
12102
diff
changeset
|
243 |
|
7617 | 244 |
realSubclassDefinerClass |
17678 | 245 |
"Answer an evaluator class appropriate for evaluating definitions of new |
246 |
subclasses of this class." |
|
247 |
||
248 |
"cg: @jan - what is the difference to the subclassDefinerClass?" |
|
7617 | 249 |
^ self evaluatorClass |
250 |
! |
|
251 |
||
5994
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
252 |
subclassDefinerClass |
12094 | 253 |
"Answer an evaluator class appropriate for evaluating definitions of new |
5994
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
254 |
subclasses of this class." |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
255 |
|
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
256 |
^ self evaluatorClass |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
257 |
|
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
258 |
|
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
259 |
! |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
260 |
|
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
261 |
syntaxHighlighterClass |
12094 | 262 |
"return the class to use for syntaxHighlighting (prettyPrinting) this class - |
5994
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
263 |
this can be redefined in special classes, to highlight classes with |
17678 | 264 |
JavaScript, Ruby, Lisp, Prolog, ASN1, Basic :-) or whatever syntax." |
5994
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
265 |
|
12149
797e3911c35d
added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents:
12102
diff
changeset
|
266 |
^ self programmingLanguage syntaxHighlighterClass. |
5994
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
267 |
|
12102 | 268 |
" |
269 |
Array syntaxHighlighterClass |
|
270 |
" |
|
5994
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
271 |
! ! |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
272 |
|
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
273 |
!Metaclass methodsFor:'copying'! |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
274 |
|
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
275 |
postCopy |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
276 |
"redefined - a copy may have a new instance" |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
277 |
|
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
278 |
myClass := nil |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
279 |
! ! |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
280 |
|
1 | 281 |
!Metaclass methodsFor:'creating classes'! |
282 |
||
10475 | 283 |
name:newName inEnvironment:aNameSpaceOrOwningClass |
12094 | 284 |
subclassOf:aClass |
285 |
instanceVariableNames:stringOfInstVarNames |
|
286 |
variable:variableBoolean |
|
287 |
words:wordsBoolean |
|
288 |
pointers:pointersBoolean |
|
289 |
classVariableNames:stringOfClassVarNames |
|
290 |
poolDictionaries:stringOfPoolNames |
|
291 |
category:categoryString |
|
292 |
comment:commentString |
|
293 |
changed:changed |
|
6824
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
294 |
|
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
295 |
^ self |
12094 | 296 |
name:newName |
297 |
inEnvironment:aNameSpaceOrOwningClass |
|
298 |
subclassOf:aClass |
|
299 |
instanceVariableNames:stringOfInstVarNames |
|
300 |
variable:variableBoolean |
|
301 |
words:wordsBoolean |
|
302 |
pointers:pointersBoolean |
|
303 |
classVariableNames:stringOfClassVarNames |
|
304 |
poolDictionaries:stringOfPoolNames |
|
305 |
category:categoryString |
|
306 |
comment:commentString |
|
307 |
changed:changed |
|
308 |
classInstanceVariableNames:nil |
|
6824
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
309 |
|
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
310 |
"Modified: 16.6.1997 / 11:53:58 / cg" |
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
311 |
! |
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
312 |
|
10475 | 313 |
name:newName inEnvironment:aNameSpaceOrOwningClass |
19115 | 314 |
subclassOf:aClass |
315 |
instanceVariableNames:stringOfInstVarNames |
|
316 |
variable:variableBoolean |
|
317 |
words:wordsBoolean |
|
318 |
pointers:pointersBoolean |
|
319 |
classVariableNames:stringOfClassVarNames |
|
320 |
poolDictionaries:stringOfPoolNames |
|
321 |
category:categoryString |
|
322 |
comment:commentString |
|
323 |
changed:changed |
|
324 |
classInstanceVariableNames:stringOfClassInstVarNamesOrNil |
|
1439 | 325 |
|
326 |
"this is the main workhorse for installing new classes - special care |
|
327 |
has to be taken, when changing an existing classes definition. In this |
|
328 |
case, some or all of the methods and subclasses methods have to be |
|
329 |
recompiled. |
|
19115 | 330 |
Also, the old class(es) are still kept (but not accessible as a global), |
12094 | 331 |
to allow existing instances some life. |
1439 | 332 |
This might change in the future. |
333 |
" |
|
6021 | 334 |
|builder| |
335 |
||
6516
68fdff63c92b
allow for classBuilder to be provided by subclasses
Claus Gittinger <cg@exept.de>
parents:
6082
diff
changeset
|
336 |
builder := self newClassBuilder. |
12094 | 337 |
builder name:newName |
19115 | 338 |
inEnvironment:aNameSpaceOrOwningClass |
339 |
subclassOf:aClass |
|
340 |
instanceVariableNames:stringOfInstVarNames |
|
341 |
variable:variableBoolean |
|
342 |
words:wordsBoolean |
|
343 |
pointers:pointersBoolean |
|
344 |
classVariableNames:stringOfClassVarNames |
|
345 |
poolDictionaries:stringOfPoolNames |
|
346 |
category:categoryString |
|
347 |
comment:commentString |
|
348 |
changed:changed |
|
349 |
classInstanceVariableNames:stringOfClassInstVarNamesOrNil. |
|
6021 | 350 |
^ builder buildClass. |
351 |
! |
|
352 |
||
353 |
new |
|
354 |
"create & return a new metaclass (a classes class). |
|
355 |
Since metaclasses only have one instance (the class), |
|
356 |
complain if there is already one. |
|
357 |
You get a new class by sending #new to the returned metaclass |
|
358 |
(confusing - isn't it ?)" |
|
359 |
||
360 |
|newClass| |
|
361 |
||
362 |
myClass notNil ifTrue:[ |
|
12094 | 363 |
self error:'Each metaclass may only have one instance'. |
6021 | 364 |
]. |
365 |
newClass := self basicNew. |
|
12094 | 366 |
newClass |
367 |
setSuperclass:Object |
|
368 |
methodDictionary:(MethodDictionary new) |
|
369 |
instSize:0 |
|
370 |
flags:(Behavior flagBehavior). |
|
6021 | 371 |
myClass := newClass. |
372 |
^ newClass |
|
373 |
||
374 |
"Modified: 1.4.1997 / 15:44:50 / stefan" |
|
6516
68fdff63c92b
allow for classBuilder to be provided by subclasses
Claus Gittinger <cg@exept.de>
parents:
6082
diff
changeset
|
375 |
! |
68fdff63c92b
allow for classBuilder to be provided by subclasses
Claus Gittinger <cg@exept.de>
parents:
6082
diff
changeset
|
376 |
|
68fdff63c92b
allow for classBuilder to be provided by subclasses
Claus Gittinger <cg@exept.de>
parents:
6082
diff
changeset
|
377 |
newClassBuilder |
7617 | 378 |
^ ClassBuilder new metaclass:self class. |
1 | 379 |
! ! |
380 |
||
5562 | 381 |
!Metaclass methodsFor:'enumerating'! |
382 |
||
6078
13d651d69246
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
6021
diff
changeset
|
383 |
instAndClassSelectorsAndMethodsDo:aTwoArgBlock |
13d651d69246
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
6021
diff
changeset
|
384 |
myClass instAndClassSelectorsAndMethodsDo:aTwoArgBlock |
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
385 |
! |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
386 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
387 |
subclassesDo:aBlock |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
388 |
"evaluate the argument, aBlock for all immediate subclasses. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
389 |
This will only enumerate globally known classes - for anonymous |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
390 |
behaviors, you have to walk over all instances of Behavior." |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
391 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
392 |
"metaclasses are not found via Smalltalk allClassesDo: |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
393 |
here, walk over classes and enumerate corresponding metas" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
394 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
395 |
self soleInstance subclassesDo:[:aSubClass | |
12094 | 396 |
aBlock value:aSubClass class |
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
397 |
]. |
5562 | 398 |
! ! |
399 |
||
3640
523d80dfc3ac
added #fileOutDefinitionOn: (show c-instVars) for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3629
diff
changeset
|
400 |
!Metaclass methodsFor:'fileOut'! |
523d80dfc3ac
added #fileOutDefinitionOn: (show c-instVars) for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3629
diff
changeset
|
401 |
|
12094 | 402 |
basicFileOutDefinitionOf:aClass on:aStream withNameSpace:forceNameSpace withPackage:showPackage |
7617 | 403 |
"append an expression on aStream, which defines myself." |
404 |
||
8716 | 405 |
|syntaxHilighting| |
7617 | 406 |
|
407 |
UserPreferences isNil ifTrue:[ |
|
12094 | 408 |
syntaxHilighting := false |
7617 | 409 |
] ifFalse:[ |
12094 | 410 |
syntaxHilighting := UserPreferences current syntaxColoring. |
7617 | 411 |
]. |
8716 | 412 |
self |
12094 | 413 |
basicFileOutDefinitionOf:aClass |
414 |
on:aStream |
|
415 |
withNameSpace:forceNameSpace |
|
416 |
withPackage:showPackage |
|
417 |
syntaxHilighting:syntaxHilighting |
|
8716 | 418 |
! |
419 |
||
420 |
basicFileOutDefinitionOf:aClass on:aStream withNameSpace:forceNameSpace withPackage:showPackage syntaxHilighting:syntaxHilighting |
|
421 |
"append an expression on aStream, which defines myself." |
|
422 |
||
17277 | 423 |
|s owner namespace nsName fullName forceNoNameSpace superNameWithoutNameSpacePrefix cls topOwner |
9689
6213791d1760
do not store NoProject-classes (leave them unspecified in the source)
Claus Gittinger <cg@exept.de>
parents:
9197
diff
changeset
|
424 |
superclass superclassNamespace nm useStoreString boldOn boldOff pkg| |
8765
97227ad9480c
care for non-valid classnames (spaces in name)
Claus Gittinger <cg@exept.de>
parents:
8716
diff
changeset
|
425 |
|
97227ad9480c
care for non-valid classnames (spaces in name)
Claus Gittinger <cg@exept.de>
parents:
8716
diff
changeset
|
426 |
syntaxHilighting ifTrue:[ |
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
427 |
boldOn := [aStream bold]. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
428 |
boldOff := [aStream normal]. |
8765
97227ad9480c
care for non-valid classnames (spaces in name)
Claus Gittinger <cg@exept.de>
parents:
8716
diff
changeset
|
429 |
]. |
7617 | 430 |
|
431 |
fullName := FileOutNameSpaceQuerySignal query == true. |
|
432 |
owner := aClass owningClass. |
|
17277 | 433 |
namespace := aClass topNameSpace. |
7617 | 434 |
|
435 |
(showPackage and:[owner isNil]) ifTrue:[ |
|
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
436 |
pkg := aClass getPackage. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
437 |
(pkg notNil and:[pkg ~= PackageId noProjectID]) ifTrue:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
438 |
aStream nextPutAll:'"{ Package: '''. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
439 |
aStream nextPutAll:aClass package asString. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
440 |
aStream nextPutAll:''' }"'; cr; cr. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
441 |
] |
7617 | 442 |
]. |
443 |
||
16232
c561a9ff8d9f
Always file out namespace using namespace pragma, even for private classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15956
diff
changeset
|
444 |
|
c561a9ff8d9f
Always file out namespace using namespace pragma, even for private classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15956
diff
changeset
|
445 |
"/ No, always use namespace pragma, otherwise when reading back |
c561a9ff8d9f
Always file out namespace using namespace pragma, even for private classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15956
diff
changeset
|
446 |
"/ from stream, we need somehow to tell what's namespace and what's |
c561a9ff8d9f
Always file out namespace using namespace pragma, even for private classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15956
diff
changeset
|
447 |
"/ a private class in another class. So namespaces are **aleays** denoted by |
c561a9ff8d9f
Always file out namespace using namespace pragma, even for private classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15956
diff
changeset
|
448 |
"/ namespace pragma. |
c561a9ff8d9f
Always file out namespace using namespace pragma, even for private classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15956
diff
changeset
|
449 |
|
7617 | 450 |
"/ the backward compatible namespace directive is only used |
451 |
"/ for non-private classes. |
|
452 |
"/ Private classes cannot be filed into another smalltalk anyway, |
|
453 |
"/ and there is no need to complicate global lookup in stc... |
|
16232
c561a9ff8d9f
Always file out namespace using namespace pragma, even for private classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15956
diff
changeset
|
454 |
"/ |
c561a9ff8d9f
Always file out namespace using namespace pragma, even for private classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15956
diff
changeset
|
455 |
"/ owner notNil ifTrue:[ |
c561a9ff8d9f
Always file out namespace using namespace pragma, even for private classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15956
diff
changeset
|
456 |
"/ forceNoNameSpace := ForceNoNameSpaceQuerySignal query == true. |
c561a9ff8d9f
Always file out namespace using namespace pragma, even for private classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15956
diff
changeset
|
457 |
"/ forceNoNameSpace ifFalse:[ |
c561a9ff8d9f
Always file out namespace using namespace pragma, even for private classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15956
diff
changeset
|
458 |
"/ fullName := true. |
c561a9ff8d9f
Always file out namespace using namespace pragma, even for private classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15956
diff
changeset
|
459 |
"/ ] |
c561a9ff8d9f
Always file out namespace using namespace pragma, even for private classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15956
diff
changeset
|
460 |
"/ ]. |
7617 | 461 |
|
462 |
fullName ifFalse:[ |
|
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
463 |
(owner isNil or:[forceNameSpace]) ifTrue:[ |
17277 | 464 |
(namespace notNil and:[namespace ~~ Smalltalk]) ifTrue:[ |
465 |
nsName := namespace name. |
|
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
466 |
(nsName includes:$:) ifTrue:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
467 |
nsName := '''' , nsName , '''' |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
468 |
]. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
469 |
aStream nextPutAll:'"{ NameSpace: '. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
470 |
boldOn value. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
471 |
aStream nextPutAll:nsName. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
472 |
boldOff value. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
473 |
aStream nextPutAll:' }"'; cr; cr. |
17277 | 474 |
] ifFalse:[ |
475 |
"/ always write a namespace directive - even for smalltalk classes. |
|
476 |
"/ reason: the fileout might go into a big file containing multiple classes |
|
477 |
"/ in different namespaces (otherwise, the smalltalk class would later be filed into |
|
478 |
"/ the previous class's namespace) |
|
479 |
aStream nextPutAll:'"{ NameSpace: Smalltalk }"'; cr; cr. |
|
480 |
]. |
|
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
481 |
]. |
7617 | 482 |
]. |
483 |
||
484 |
"take care of nil-superclass" |
|
485 |
superclass := aClass superclass. |
|
486 |
superclass isNil ifTrue:[ |
|
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
487 |
s := 'nil' |
7617 | 488 |
] ifFalse:[ |
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
489 |
superclassNamespace := superclass nameSpace. |
9197 | 490 |
|
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
491 |
"/ be careful: if the superclasses ns is Smalltalk, |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
492 |
"/ AND this is the definition of a private class, |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
493 |
"/ AND a private class with the same name as my superclas |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
494 |
"/ exists in my owning class, |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
495 |
"/ THEN we MUST add the smalltalk-prefix. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
496 |
"/ (otherwise, we get the private class as superclass when accepting the |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
497 |
"/ next time) |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
498 |
(owner notNil |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
499 |
and:[ superclassNamespace == Smalltalk |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
500 |
and:[ (owner privateClassesAt:superclass name) notNil ]]) ifTrue:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
501 |
s := superclass nameWithNameSpacePrefix. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
502 |
] ifFalse:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
503 |
fullName ifTrue:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
504 |
s := superclass name. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
505 |
] ifFalse:[ |
17277 | 506 |
(namespace == superclassNamespace |
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
507 |
and:[superclass owningClass isNil]) ifTrue:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
508 |
"/ superclass is in the same namespace and not private; |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
509 |
"/ still prepend namespace prefix for private classes, |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
510 |
"/ to avoid confusing stc, which needs that information. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
511 |
"/ LATE note (AUG2002) - no longer; stc was fixed. |
7617 | 512 |
"/ owner notNil ifTrue:[ |
513 |
"/ s := superclass name |
|
514 |
"/ ] ifFalse:[ |
|
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
515 |
s := superclass nameWithoutPrefix |
7617 | 516 |
"/ ] |
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
517 |
] ifFalse:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
518 |
"/ a very special (rare) situation: |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
519 |
"/ my superclass resides in another nameSpace, |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
520 |
"/ but there is something else named like this |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
521 |
"/ to be found in my nameSpace (or a private class) |
7617 | 522 |
|
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
523 |
superNameWithoutNameSpacePrefix := superclass nameWithoutNameSpacePrefix asSymbol. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
524 |
cls := aClass privateClassesAt:superNameWithoutNameSpacePrefix. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
525 |
cls isNil ifTrue:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
526 |
(topOwner := aClass topOwningClass) isNil ifTrue:[ |
17277 | 527 |
namespace := aClass nameSpace. |
528 |
namespace notNil ifTrue:[ |
|
529 |
cls := namespace privateClassesAt:superNameWithoutNameSpacePrefix |
|
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
530 |
] ifFalse:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
531 |
"/ aClass error:'unexpected nil namespace' |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
532 |
] |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
533 |
] ifFalse:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
534 |
cls := topOwner nameSpace at:superNameWithoutNameSpacePrefix. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
535 |
] |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
536 |
]. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
537 |
(cls notNil and:[cls ~~ superclass]) ifTrue:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
538 |
s := superclassNamespace name , '::' , superNameWithoutNameSpacePrefix |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
539 |
] ifFalse:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
540 |
"/ no class with that name found in my namespace ... |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
541 |
"/ if the superclass resides in Smalltalk, |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
542 |
"/ suppress prefix; otherwise, use full prefix. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
543 |
(superclassNamespace notNil |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
544 |
and:[superclassNamespace ~~ Smalltalk]) ifTrue:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
545 |
(owner notNil |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
546 |
and:[(topOwner := owner topOwningClass) notNil |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
547 |
and:[superclass topOwningClass notNil |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
548 |
and:[topOwner nameSpace == superclass topOwningClass "owningClass" nameSpace] |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
549 |
]]) ifTrue:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
550 |
s := superNameWithoutNameSpacePrefix |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
551 |
] ifFalse:[ |
17277 | 552 |
namespace == superclass topNameSpace ifTrue:[ |
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
553 |
s := superNameWithoutNameSpacePrefix |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
554 |
] ifFalse:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
555 |
s := superclass name |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
556 |
] |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
557 |
] |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
558 |
] ifFalse:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
559 |
s := superNameWithoutNameSpacePrefix |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
560 |
] |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
561 |
] |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
562 |
] |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
563 |
] |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
564 |
] |
7617 | 565 |
]. |
566 |
||
9175
2d009bbc418b
care for definition of a class, where the superclass
Claus Gittinger <cg@exept.de>
parents:
8765
diff
changeset
|
567 |
boldOn value. |
7617 | 568 |
aStream nextPutAll:s. "/ superclass |
9175
2d009bbc418b
care for definition of a class, where the superclass
Claus Gittinger <cg@exept.de>
parents:
8765
diff
changeset
|
569 |
boldOff value. |
7617 | 570 |
aStream space. |
571 |
aClass basicFileOutInstvarTypeKeywordOn:aStream. |
|
572 |
||
8765
97227ad9480c
care for non-valid classnames (spaces in name)
Claus Gittinger <cg@exept.de>
parents:
8716
diff
changeset
|
573 |
useStoreString := false. |
7617 | 574 |
(fullName and:[owner isNil]) ifTrue:[ |
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
575 |
nm := aClass name. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
576 |
useStoreString := true. |
8765
97227ad9480c
care for non-valid classnames (spaces in name)
Claus Gittinger <cg@exept.de>
parents:
8716
diff
changeset
|
577 |
] ifFalse:[ |
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
578 |
nm := aClass nameWithoutPrefix. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
579 |
nm isValidSmalltalkIdentifier ifFalse:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
580 |
useStoreString := true. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
581 |
]. |
8765
97227ad9480c
care for non-valid classnames (spaces in name)
Claus Gittinger <cg@exept.de>
parents:
8716
diff
changeset
|
582 |
]. |
97227ad9480c
care for non-valid classnames (spaces in name)
Claus Gittinger <cg@exept.de>
parents:
8716
diff
changeset
|
583 |
aStream nextPut:$#. |
97227ad9480c
care for non-valid classnames (spaces in name)
Claus Gittinger <cg@exept.de>
parents:
8716
diff
changeset
|
584 |
useStoreString ifTrue:[ |
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
585 |
aStream nextPutAll:''''. |
8765
97227ad9480c
care for non-valid classnames (spaces in name)
Claus Gittinger <cg@exept.de>
parents:
8716
diff
changeset
|
586 |
]. |
9175
2d009bbc418b
care for definition of a class, where the superclass
Claus Gittinger <cg@exept.de>
parents:
8765
diff
changeset
|
587 |
boldOn value. |
8765
97227ad9480c
care for non-valid classnames (spaces in name)
Claus Gittinger <cg@exept.de>
parents:
8716
diff
changeset
|
588 |
aStream nextPutAll:nm. |
9175
2d009bbc418b
care for definition of a class, where the superclass
Claus Gittinger <cg@exept.de>
parents:
8765
diff
changeset
|
589 |
boldOff value. |
8765
97227ad9480c
care for non-valid classnames (spaces in name)
Claus Gittinger <cg@exept.de>
parents:
8716
diff
changeset
|
590 |
useStoreString ifTrue:[ |
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
591 |
aStream nextPutAll:''''. |
7617 | 592 |
]. |
593 |
||
12094 | 594 |
aStream crtab. |
7617 | 595 |
aStream nextPutAll:'instanceVariableNames:'''. |
9175
2d009bbc418b
care for definition of a class, where the superclass
Claus Gittinger <cg@exept.de>
parents:
8765
diff
changeset
|
596 |
boldOn value. |
7617 | 597 |
aClass printInstVarNamesOn:aStream indent:16. |
9175
2d009bbc418b
care for definition of a class, where the superclass
Claus Gittinger <cg@exept.de>
parents:
8765
diff
changeset
|
598 |
boldOff value. |
7617 | 599 |
aStream nextPutAll:''''. |
600 |
||
601 |
aStream crtab. |
|
602 |
aStream nextPutAll:'classVariableNames:'''. |
|
9175
2d009bbc418b
care for definition of a class, where the superclass
Claus Gittinger <cg@exept.de>
parents:
8765
diff
changeset
|
603 |
boldOn value. |
7617 | 604 |
aClass printClassVarNamesOn:aStream indent:16. |
9175
2d009bbc418b
care for definition of a class, where the superclass
Claus Gittinger <cg@exept.de>
parents:
8765
diff
changeset
|
605 |
boldOff value. |
7617 | 606 |
aStream nextPutAll:''''. |
607 |
||
608 |
aStream crtab. |
|
8551 | 609 |
aStream nextPutAll:'poolDictionaries:'''. |
9175
2d009bbc418b
care for definition of a class, where the superclass
Claus Gittinger <cg@exept.de>
parents:
8765
diff
changeset
|
610 |
boldOn value. |
8551 | 611 |
aClass printSharedPoolNamesOn:aStream indent:16. |
9175
2d009bbc418b
care for definition of a class, where the superclass
Claus Gittinger <cg@exept.de>
parents:
8765
diff
changeset
|
612 |
boldOff value. |
8551 | 613 |
aStream nextPutAll:''''. |
7617 | 614 |
|
615 |
aStream crtab. |
|
616 |
owner isNil ifTrue:[ |
|
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
617 |
"/ a public class |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
618 |
aStream nextPutAll:'category:'. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
619 |
aClass category isNil ifTrue:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
620 |
s := '''''' |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
621 |
] ifFalse:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
622 |
s := aClass category asString storeString |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
623 |
]. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
624 |
aStream nextPutAll:s. |
7617 | 625 |
] ifFalse:[ |
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
626 |
"/ a private class |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
627 |
aStream nextPutAll:'privateIn:'. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
628 |
boldOn value. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
629 |
fullName ifTrue:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
630 |
s := owner name. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
631 |
] ifFalse:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
632 |
s := owner nameWithoutNameSpacePrefix. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
633 |
]. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
634 |
aStream nextPutAll:s. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
635 |
boldOff value. |
7617 | 636 |
]. |
637 |
aStream cr |
|
638 |
||
10739
9602cd5ad8a0
changed #basicFileOutDefinitionOf:on:withNameSpace:withPackage:syntaxHilighting:
Claus Gittinger <cg@exept.de>
parents:
10475
diff
changeset
|
639 |
"Created: / 04-01-1997 / 20:38:16 / cg" |
9602cd5ad8a0
changed #basicFileOutDefinitionOf:on:withNameSpace:withPackage:syntaxHilighting:
Claus Gittinger <cg@exept.de>
parents:
10475
diff
changeset
|
640 |
"Modified: / 18-03-1999 / 18:15:46 / stefan" |
10740 | 641 |
"Modified: / 08-10-2007 / 13:28:59 / cg" |
16232
c561a9ff8d9f
Always file out namespace using namespace pragma, even for private classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15956
diff
changeset
|
642 |
"Modified: / 06-03-2014 / 10:32:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7617 | 643 |
! |
644 |
||
8277
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
645 |
fileOutClassInstVarDefinitionOn:aStream withNameSpace:withNameSpace |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
646 |
"append an expression to define my classInstanceVariables on aStream" |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
647 |
|
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
648 |
|anySuperClassInstVar| |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
649 |
|
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
650 |
myClass isLoaded ifFalse:[ |
12094 | 651 |
^ myClass basicFileOutDefinitionOn:aStream withNameSpace:withNameSpace |
8277
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
652 |
]. |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
653 |
|
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
654 |
withNameSpace ifTrue:[ |
12094 | 655 |
myClass name printOn:aStream. |
8277
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
656 |
] ifFalse:[ |
12094 | 657 |
myClass printClassNameOn:aStream. |
8277
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
658 |
]. |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
659 |
aStream nextPutAll:' class instanceVariableNames:'''. |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
660 |
self printInstVarNamesOn:aStream indent:8. |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
661 |
aStream nextPutAll:''''. |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
662 |
|
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
663 |
"mhmh - good idea; saw this in SmallDraw sourcecode ..." |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
664 |
|
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
665 |
anySuperClassInstVar := false. |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
666 |
myClass allSuperclassesDo:[:aSuperClass | |
12094 | 667 |
aSuperClass class instVarNames do:[:ignored | anySuperClassInstVar := true]. |
8277
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
668 |
]. |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
669 |
|
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
670 |
aStream cr; cr; nextPut:(Character doubleQuote); cr; space. |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
671 |
anySuperClassInstVar ifFalse:[ |
12094 | 672 |
aStream |
673 |
nextPutLine:'No other class instance variables are inherited by this class.'. |
|
8277
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
674 |
] ifTrue:[ |
12094 | 675 |
aStream |
676 |
nextPutLine:'The following class instance variables are inherited by this class:'. |
|
677 |
aStream cr. |
|
678 |
myClass allSuperclassesDo:[:aSuperClass | |
|
679 |
aStream tab; nextPutAll:aSuperClass name; nextPutAll:' - '. |
|
680 |
aStream nextPutLine:(aSuperClass class instanceVariableString). |
|
681 |
]. |
|
8277
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
682 |
|
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
683 |
]. |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
684 |
aStream nextPut:(Character doubleQuote); cr. |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
685 |
|
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
686 |
"Created: / 10.12.1995 / 16:31:25 / cg" |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
687 |
"Modified: / 1.4.1997 / 16:00:33 / stefan" |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
688 |
"Modified: / 3.2.2000 / 23:05:28 / cg" |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
689 |
! |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
690 |
|
3640
523d80dfc3ac
added #fileOutDefinitionOn: (show c-instVars) for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3629
diff
changeset
|
691 |
fileOutDefinitionOn:aStream |
523d80dfc3ac
added #fileOutDefinitionOn: (show c-instVars) for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3629
diff
changeset
|
692 |
myClass fileOutClassInstVarDefinitionOn:aStream |
523d80dfc3ac
added #fileOutDefinitionOn: (show c-instVars) for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3629
diff
changeset
|
693 |
|
523d80dfc3ac
added #fileOutDefinitionOn: (show c-instVars) for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3629
diff
changeset
|
694 |
"Modified: / 21.6.1998 / 04:10:02 / cg" |
8228 | 695 |
! |
696 |
||
697 |
fileOutOn:outStreamArg withTimeStamp:stampIt withInitialize:initIt withDefinition:withDefinition methodFilter:methodFilter encoder:encoderOrNil |
|
698 |
"file out my definition and all methods onto aStream. |
|
699 |
If stampIt is true, a timeStamp comment is prepended. |
|
700 |
If initIt is true, and the class implements a class-initialize method, |
|
701 |
append a corresponding doIt expression for initialization. |
|
702 |
The order by which the fileOut is done is used to put the version string at the end. |
|
703 |
Thus, if the version string is expanded (by CVS), the characterPositions of methods should not move" |
|
704 |
||
12149
797e3911c35d
added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents:
12102
diff
changeset
|
705 |
self programmingLanguage sourceFileWriterClass new |
797e3911c35d
added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents:
12102
diff
changeset
|
706 |
fileOut:myClass on:outStreamArg withTimeStamp:stampIt |
797e3911c35d
added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents:
12102
diff
changeset
|
707 |
withInitialize:initIt withDefinition:withDefinition |
797e3911c35d
added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents:
12102
diff
changeset
|
708 |
methodFilter:methodFilter encoder:encoderOrNil |
3640
523d80dfc3ac
added #fileOutDefinitionOn: (show c-instVars) for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3629
diff
changeset
|
709 |
! ! |
523d80dfc3ac
added #fileOutDefinitionOn: (show c-instVars) for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3629
diff
changeset
|
710 |
|
12029 | 711 |
!Metaclass methodsFor:'method templates'! |
712 |
||
713 |
versionMethodTemplateForSourceCodeManager:aSourceCodeManager |
|
714 |
^ aSourceCodeManager versionMethodTemplateForSmalltalk |
|
715 |
! ! |
|
716 |
||
12094 | 717 |
!Metaclass methodsFor:'misc ui support'! |
718 |
||
719 |
iconInBrowserSymbol |
|
720 |
"can be redefined for a private icon in the browser. |
|
721 |
The returned symbol must be a selector of the ToolbarIconLibrary." |
|
722 |
||
723 |
^ nil |
|
724 |
! ! |
|
725 |
||
1875 | 726 |
!Metaclass methodsFor:'private'! |
68 | 727 |
|
12094 | 728 |
setSoleInstance:aClass |
6021 | 729 |
myClass := aClass |
730 |
||
731 |
"Created: 12.12.1995 / 13:46:22 / cg" |
|
1 | 732 |
! ! |
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
733 |
|
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
734 |
!Metaclass methodsFor:'queries'! |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
735 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
736 |
category |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
737 |
"return my category" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
738 |
|
12094 | 739 |
myClass isNil ifTrue:[^ nil]. |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
740 |
^ myClass category |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
741 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
742 |
"Created: 2.4.1997 / 00:46:11 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
743 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
744 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
745 |
comment |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
746 |
"return my comment" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
747 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
748 |
^ myClass comment |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
749 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
750 |
"Created: 2.4.1997 / 00:51:35 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
751 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
752 |
|
9712 | 753 |
getPackage |
754 |
"return my package-id" |
|
755 |
||
756 |
^ myClass getPackage |
|
757 |
||
758 |
"Created: 15.10.1996 / 19:44:51 / cg" |
|
759 |
! |
|
760 |
||
5574 | 761 |
hasExtensions |
762 |
"return true if I have extensions" |
|
763 |
||
764 |
^ myClass hasExtensions |
|
765 |
||
766 |
! |
|
767 |
||
5659 | 768 |
hasExtensionsFrom:aPackageID |
769 |
"return true if I have extensions from a package" |
|
770 |
||
771 |
^ myClass hasExtensionsFrom:aPackageID |
|
772 |
! |
|
773 |
||
1179
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1087
diff
changeset
|
774 |
isBuiltInClass |
1266 | 775 |
"return true if this class is known by the run-time-system. |
776 |
Here, true is returned for myself, false for subclasses." |
|
777 |
||
1179
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1087
diff
changeset
|
778 |
^ self == Metaclass class or:[self == Metaclass] |
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1087
diff
changeset
|
779 |
|
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1087
diff
changeset
|
780 |
"Created: 15.4.1996 / 17:17:34 / cg" |
1266 | 781 |
"Modified: 23.4.1996 / 15:59:37 / cg" |
1179
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1087
diff
changeset
|
782 |
! |
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1087
diff
changeset
|
783 |
|
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
784 |
isMeta |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
785 |
"return true, if the receiver is some kind of metaclass; |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
786 |
true is returned here. Redefines isMeta in Object" |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
787 |
|
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
788 |
^ true |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
789 |
! |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
790 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
791 |
name |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
792 |
"return my name - that is the name of my sole class, with ' class' |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
793 |
appended." |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
794 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
795 |
|nm| |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
796 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
797 |
myClass isNil ifTrue:[ |
12094 | 798 |
^ #someMetaclass |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
799 |
]. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
800 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
801 |
(nm := myClass name) isNil ifTrue:[ |
12094 | 802 |
'Metaclass [warning]: no name in my class' errorPrintCR. |
803 |
^ #'unnamed class' |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
804 |
]. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
805 |
^ nm , ' class' |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
806 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
807 |
"Modified: 10.1.1997 / 17:55:08 / cg" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
808 |
"Modified: 1.4.1997 / 15:53:11 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
809 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
810 |
|
1920 | 811 |
nameSpace |
812 |
"return the nameSpace I am contained in. |
|
813 |
Due to the implementation of nameSpaces (as classVariables), |
|
814 |
a class can only be contained in one nameSpace (which is the desired)" |
|
815 |
||
816 |
"/ this information is in the class |
|
817 |
||
818 |
^ myClass nameSpace |
|
819 |
||
820 |
"Created: 7.11.1996 / 13:18:52 / cg" |
|
821 |
! |
|
822 |
||
1724 | 823 |
owningClass |
824 |
"return nil here - regular metaclasses are never private" |
|
825 |
||
826 |
^ nil |
|
827 |
||
828 |
"Created: 12.10.1996 / 20:12:16 / cg" |
|
829 |
! |
|
830 |
||
1757 | 831 |
package |
832 |
"return my package-id" |
|
833 |
||
834 |
^ myClass package |
|
835 |
||
836 |
"Created: 15.10.1996 / 19:44:51 / cg" |
|
837 |
! |
|
838 |
||
18890 | 839 |
sharedPools |
840 |
^ myClass sharedPools |
|
841 |
! |
|
842 |
||
12094 | 843 |
soleInstance |
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
844 |
"return my sole class." |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
845 |
|
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
846 |
^ myClass |
2047 | 847 |
! |
848 |
||
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
849 |
subclasses |
12835 | 850 |
"ask my non-meta for subclasses" |
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
851 |
|
12835 | 852 |
^ myClass subclasses collect:[:theNonMetaClass | theNonMetaClass class]. |
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
853 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
854 |
" |
12835 | 855 |
Integer class subclasses |
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
856 |
" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
857 |
! |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
858 |
|
5217
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
859 |
theMetaclass |
9695 | 860 |
"return the metaClass of the class-meta pair. |
861 |
Here, return myself, because I am the metaclass. |
|
862 |
Also implemented in my class, which also returns me." |
|
5217
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
863 |
|
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
864 |
^ self |
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
865 |
|
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
866 |
"Created: / 30.1.2000 / 23:08:15 / cg" |
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
867 |
"Modified: / 31.1.2000 / 16:15:00 / cg" |
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
868 |
! |
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
869 |
|
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
870 |
theNonMetaclass |
9695 | 871 |
"return the nonMetaClass of the class-meta pair. |
872 |
Here, return my class object, because I am the metaclass. |
|
17592 | 873 |
Also implemented in my class, which returns itself. |
874 |
Sigh: ST/X naming; Squeak calls this theNonMetaClass" |
|
5217
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
875 |
|
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
876 |
^ self soleInstance |
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
877 |
|
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
878 |
"Created: / 30.1.2000 / 23:08:11 / cg" |
5218 | 879 |
"Modified: / 31.1.2000 / 16:17:02 / cg" |
5217
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
880 |
! |
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
881 |
|
2047 | 882 |
topOwningClass |
883 |
"return nil here - regular metaclasses are never private" |
|
884 |
||
885 |
^ nil |
|
886 |
||
887 |
"Created: 3.1.1997 / 19:18:06 / cg" |
|
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
888 |
! ! |
621 | 889 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
890 |
!Metaclass methodsFor:'source management'! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
891 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
892 |
binaryRevision |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
893 |
^ myClass binaryRevision |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
894 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
895 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
896 |
Object binaryRevision |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
897 |
Object class binaryRevision |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
898 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
899 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
900 |
"Modified: 2.4.1997 / 01:17:04 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
901 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
902 |
|
13475
76bd767cfcee
added: #binaryRevisionString
Claus Gittinger <cg@exept.de>
parents:
13407
diff
changeset
|
903 |
binaryRevisionString |
76bd767cfcee
added: #binaryRevisionString
Claus Gittinger <cg@exept.de>
parents:
13407
diff
changeset
|
904 |
^ myClass binaryRevisionString |
76bd767cfcee
added: #binaryRevisionString
Claus Gittinger <cg@exept.de>
parents:
13407
diff
changeset
|
905 |
|
76bd767cfcee
added: #binaryRevisionString
Claus Gittinger <cg@exept.de>
parents:
13407
diff
changeset
|
906 |
" |
76bd767cfcee
added: #binaryRevisionString
Claus Gittinger <cg@exept.de>
parents:
13407
diff
changeset
|
907 |
Object binaryRevisionString |
76bd767cfcee
added: #binaryRevisionString
Claus Gittinger <cg@exept.de>
parents:
13407
diff
changeset
|
908 |
Object class binaryRevisionString |
76bd767cfcee
added: #binaryRevisionString
Claus Gittinger <cg@exept.de>
parents:
13407
diff
changeset
|
909 |
" |
76bd767cfcee
added: #binaryRevisionString
Claus Gittinger <cg@exept.de>
parents:
13407
diff
changeset
|
910 |
|
76bd767cfcee
added: #binaryRevisionString
Claus Gittinger <cg@exept.de>
parents:
13407
diff
changeset
|
911 |
"Modified: / 02-04-1997 / 01:17:04 / stefan" |
76bd767cfcee
added: #binaryRevisionString
Claus Gittinger <cg@exept.de>
parents:
13407
diff
changeset
|
912 |
"Created: / 01-07-2011 / 10:55:39 / cg" |
76bd767cfcee
added: #binaryRevisionString
Claus Gittinger <cg@exept.de>
parents:
13407
diff
changeset
|
913 |
! |
76bd767cfcee
added: #binaryRevisionString
Claus Gittinger <cg@exept.de>
parents:
13407
diff
changeset
|
914 |
|
15956 | 915 |
sourceCodeManagerFromBinaryRevision |
916 |
||
917 |
^ myClass sourceCodeManagerFromBinaryRevision |
|
918 |
||
919 |
"Modified: / 01-04-1997 / 14:36:31 / stefan" |
|
920 |
"Created: / 06-10-2011 / 09:34:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
921 |
! |
|
922 |
||
8228 | 923 |
sourceFileSuffix |
13407 | 924 |
^ self programmingLanguage sourceFileSuffix |
925 |
||
926 |
"Modified: / 15-08-2009 / 22:46:44 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
927 |
"Modified: / 28-06-2011 / 13:44:36 / cg" |
|
8228 | 928 |
! |
929 |
||
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
930 |
sourceStream |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
931 |
"return the classes source stream" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
932 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
933 |
^ myClass sourceStream |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
934 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
935 |
"Modified: 1.4.1997 / 14:36:31 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
936 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
937 |
|
4780 | 938 |
sourceStreamFor:sourceFileName |
939 |
"return the sourceStream for a sourceFileName" |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
940 |
|
4780 | 941 |
^ myClass sourceStreamFor:sourceFileName |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
942 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
943 |
"Modified: 1.4.1997 / 14:36:38 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
944 |
! ! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
945 |
|
1742 | 946 |
!Metaclass class methodsFor:'documentation'! |
639 | 947 |
|
12102 | 948 |
version_CVS |
18890 | 949 |
^ '$Header$' |
19243
b2e7db65ed4b
Added Metaclass>>dllPath
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
950 |
! |
b2e7db65ed4b
Added Metaclass>>dllPath
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
951 |
|
b2e7db65ed4b
Added Metaclass>>dllPath
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
952 |
version_HG |
b2e7db65ed4b
Added Metaclass>>dllPath
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
953 |
|
b2e7db65ed4b
Added Metaclass>>dllPath
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
954 |
^ '$Changeset: <not expanded> $' |
639 | 955 |
! ! |
6824
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
956 |
|
15956 | 957 |
|
2822
64829ed8f8c6
allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
958 |
Metaclass initialize! |