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