author | Claus Gittinger <cg@exept.de> |
Sun, 12 Feb 2017 19:07:03 +0100 | |
changeset 21407 | 6ce47a4b5aba |
parent 19115 | 64965ee348b9 |
child 21607 | 6eefa4f76f23 |
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 |
|
6021 | 172 |
^ UserPreferences systemBrowserClass. |
5994
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
173 |
|
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
174 |
"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
|
175 |
! |
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 |
compilerClass |
12094 | 178 |
"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
|
179 |
this can be redefined in special classes, to compile classes with |
17678 | 180 |
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
|
181 |
|
12149
797e3911c35d
added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents:
12102
diff
changeset
|
182 |
^ self programmingLanguage compilerClass. |
12102 | 183 |
|
184 |
" |
|
185 |
Array compilerClass |
|
186 |
" |
|
5994
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
187 |
! |
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 |
evaluatorClass |
12094 | 190 |
"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
|
191 |
this can be redefined in special classes, to evaluate expressions with |
17678 | 192 |
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
|
193 |
|
12149
797e3911c35d
added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents:
12102
diff
changeset
|
194 |
^ self programmingLanguage evaluatorClass. |
12102 | 195 |
|
196 |
" |
|
197 |
Array evaluatorClass |
|
198 |
" |
|
5994
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
199 |
! |
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 |
formatterClass |
12094 | 202 |
"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
|
203 |
this can be redefined in special classes, to format classes with |
17678 | 204 |
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
|
205 |
|
12149
797e3911c35d
added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents:
12102
diff
changeset
|
206 |
^ self programmingLanguage formatterClass. |
5994
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
207 |
|
12102 | 208 |
" |
209 |
Array formatterClass |
|
210 |
" |
|
5994
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
211 |
! |
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 |
parserClass |
12094 | 214 |
"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
|
215 |
this can be redefined in special classes, to parse classes with |
17678 | 216 |
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
|
217 |
|
12149
797e3911c35d
added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents:
12102
diff
changeset
|
218 |
^ self programmingLanguage parserClass. |
5994
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
219 |
|
12102 | 220 |
" |
221 |
Array parserClass |
|
222 |
" |
|
5994
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
223 |
! |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
224 |
|
12149
797e3911c35d
added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents:
12102
diff
changeset
|
225 |
programmingLanguage |
797e3911c35d
added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents:
12102
diff
changeset
|
226 |
"return the programming language in which this class is written" |
797e3911c35d
added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents:
12102
diff
changeset
|
227 |
|
797e3911c35d
added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents:
12102
diff
changeset
|
228 |
^ SmalltalkLanguage instance |
797e3911c35d
added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents:
12102
diff
changeset
|
229 |
|
797e3911c35d
added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents:
12102
diff
changeset
|
230 |
"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
|
231 |
"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
|
232 |
! |
797e3911c35d
added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents:
12102
diff
changeset
|
233 |
|
7617 | 234 |
realSubclassDefinerClass |
17678 | 235 |
"Answer an evaluator class appropriate for evaluating definitions of new |
236 |
subclasses of this class." |
|
237 |
||
238 |
"cg: @jan - what is the difference to the subclassDefinerClass?" |
|
7617 | 239 |
^ self evaluatorClass |
240 |
! |
|
241 |
||
5994
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
242 |
subclassDefinerClass |
12094 | 243 |
"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
|
244 |
subclasses of this class." |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
245 |
|
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
246 |
^ self evaluatorClass |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
247 |
|
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 |
syntaxHighlighterClass |
12094 | 252 |
"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
|
253 |
this can be redefined in special classes, to highlight classes with |
17678 | 254 |
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
|
255 |
|
12149
797e3911c35d
added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents:
12102
diff
changeset
|
256 |
^ self programmingLanguage syntaxHighlighterClass. |
5994
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
257 |
|
12102 | 258 |
" |
259 |
Array syntaxHighlighterClass |
|
260 |
" |
|
5994
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
261 |
! ! |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
262 |
|
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
263 |
!Metaclass methodsFor:'copying'! |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
264 |
|
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
265 |
postCopy |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
266 |
"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
|
267 |
|
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
268 |
myClass := nil |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
269 |
! ! |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
270 |
|
1 | 271 |
!Metaclass methodsFor:'creating classes'! |
272 |
||
10475 | 273 |
name:newName inEnvironment:aNameSpaceOrOwningClass |
12094 | 274 |
subclassOf:aClass |
275 |
instanceVariableNames:stringOfInstVarNames |
|
276 |
variable:variableBoolean |
|
277 |
words:wordsBoolean |
|
278 |
pointers:pointersBoolean |
|
279 |
classVariableNames:stringOfClassVarNames |
|
280 |
poolDictionaries:stringOfPoolNames |
|
281 |
category:categoryString |
|
282 |
comment:commentString |
|
283 |
changed:changed |
|
6824
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
284 |
|
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
285 |
^ self |
12094 | 286 |
name:newName |
287 |
inEnvironment:aNameSpaceOrOwningClass |
|
288 |
subclassOf:aClass |
|
289 |
instanceVariableNames:stringOfInstVarNames |
|
290 |
variable:variableBoolean |
|
291 |
words:wordsBoolean |
|
292 |
pointers:pointersBoolean |
|
293 |
classVariableNames:stringOfClassVarNames |
|
294 |
poolDictionaries:stringOfPoolNames |
|
295 |
category:categoryString |
|
296 |
comment:commentString |
|
297 |
changed:changed |
|
298 |
classInstanceVariableNames:nil |
|
6824
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
299 |
|
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
300 |
"Modified: 16.6.1997 / 11:53:58 / cg" |
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
301 |
! |
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
302 |
|
10475 | 303 |
name:newName inEnvironment:aNameSpaceOrOwningClass |
19115 | 304 |
subclassOf:aClass |
305 |
instanceVariableNames:stringOfInstVarNames |
|
306 |
variable:variableBoolean |
|
307 |
words:wordsBoolean |
|
308 |
pointers:pointersBoolean |
|
309 |
classVariableNames:stringOfClassVarNames |
|
310 |
poolDictionaries:stringOfPoolNames |
|
311 |
category:categoryString |
|
312 |
comment:commentString |
|
313 |
changed:changed |
|
314 |
classInstanceVariableNames:stringOfClassInstVarNamesOrNil |
|
1439 | 315 |
|
316 |
"this is the main workhorse for installing new classes - special care |
|
317 |
has to be taken, when changing an existing classes definition. In this |
|
318 |
case, some or all of the methods and subclasses methods have to be |
|
319 |
recompiled. |
|
19115 | 320 |
Also, the old class(es) are still kept (but not accessible as a global), |
12094 | 321 |
to allow existing instances some life. |
1439 | 322 |
This might change in the future. |
323 |
" |
|
21407 | 324 |
|builder newClass| |
6021 | 325 |
|
6516
68fdff63c92b
allow for classBuilder to be provided by subclasses
Claus Gittinger <cg@exept.de>
parents:
6082
diff
changeset
|
326 |
builder := self newClassBuilder. |
12094 | 327 |
builder name:newName |
19115 | 328 |
inEnvironment:aNameSpaceOrOwningClass |
329 |
subclassOf:aClass |
|
330 |
instanceVariableNames:stringOfInstVarNames |
|
331 |
variable:variableBoolean |
|
332 |
words:wordsBoolean |
|
333 |
pointers:pointersBoolean |
|
334 |
classVariableNames:stringOfClassVarNames |
|
335 |
poolDictionaries:stringOfPoolNames |
|
336 |
category:categoryString |
|
337 |
comment:commentString |
|
338 |
changed:changed |
|
339 |
classInstanceVariableNames:stringOfClassInstVarNamesOrNil. |
|
21407 | 340 |
newClass := builder buildClass. |
341 |
||
342 |
"/ if the class was autoloaded, and it refers to any autoloaded shared pool, |
|
343 |
"/ reference the pool now. So it will be present, when methods are compiled |
|
344 |
"/ (avoids costy recompiles which may happen, if the sharedPool is loaded |
|
345 |
"/ after the methods have been compiled assuming that those names are globals) |
|
346 |
(newClass sharedPools ? #()) do:[:each | each autoload]. |
|
347 |
^ newClass |
|
348 |
||
349 |
"Modified: / 12-02-2017 / 10:58:59 / cg" |
|
6021 | 350 |
! |
351 |
||
352 |
new |
|
353 |
"create & return a new metaclass (a classes class). |
|
354 |
Since metaclasses only have one instance (the class), |
|
355 |
complain if there is already one. |
|
356 |
You get a new class by sending #new to the returned metaclass |
|
357 |
(confusing - isn't it ?)" |
|
358 |
||
359 |
|newClass| |
|
360 |
||
361 |
myClass notNil ifTrue:[ |
|
12094 | 362 |
self error:'Each metaclass may only have one instance'. |
6021 | 363 |
]. |
364 |
newClass := self basicNew. |
|
12094 | 365 |
newClass |
366 |
setSuperclass:Object |
|
367 |
methodDictionary:(MethodDictionary new) |
|
368 |
instSize:0 |
|
369 |
flags:(Behavior flagBehavior). |
|
6021 | 370 |
myClass := newClass. |
371 |
^ newClass |
|
372 |
||
373 |
"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
|
374 |
! |
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 |
newClassBuilder |
7617 | 377 |
^ ClassBuilder new metaclass:self class. |
1 | 378 |
! ! |
379 |
||
5562 | 380 |
!Metaclass methodsFor:'enumerating'! |
381 |
||
6078
13d651d69246
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
6021
diff
changeset
|
382 |
instAndClassSelectorsAndMethodsDo:aTwoArgBlock |
13d651d69246
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
6021
diff
changeset
|
383 |
myClass instAndClassSelectorsAndMethodsDo:aTwoArgBlock |
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
384 |
! |
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 |
subclassesDo:aBlock |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
387 |
"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
|
388 |
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
|
389 |
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
|
390 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
391 |
"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
|
392 |
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
|
393 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
394 |
self soleInstance subclassesDo:[:aSubClass | |
12094 | 395 |
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
|
396 |
]. |
5562 | 397 |
! ! |
398 |
||
3640
523d80dfc3ac
added #fileOutDefinitionOn: (show c-instVars) for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3629
diff
changeset
|
399 |
!Metaclass methodsFor:'fileOut'! |
523d80dfc3ac
added #fileOutDefinitionOn: (show c-instVars) for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3629
diff
changeset
|
400 |
|
12094 | 401 |
basicFileOutDefinitionOf:aClass on:aStream withNameSpace:forceNameSpace withPackage:showPackage |
7617 | 402 |
"append an expression on aStream, which defines myself." |
403 |
||
8716 | 404 |
|syntaxHilighting| |
7617 | 405 |
|
406 |
UserPreferences isNil ifTrue:[ |
|
12094 | 407 |
syntaxHilighting := false |
7617 | 408 |
] ifFalse:[ |
12094 | 409 |
syntaxHilighting := UserPreferences current syntaxColoring. |
7617 | 410 |
]. |
8716 | 411 |
self |
12094 | 412 |
basicFileOutDefinitionOf:aClass |
413 |
on:aStream |
|
414 |
withNameSpace:forceNameSpace |
|
415 |
withPackage:showPackage |
|
416 |
syntaxHilighting:syntaxHilighting |
|
8716 | 417 |
! |
418 |
||
419 |
basicFileOutDefinitionOf:aClass on:aStream withNameSpace:forceNameSpace withPackage:showPackage syntaxHilighting:syntaxHilighting |
|
420 |
"append an expression on aStream, which defines myself." |
|
421 |
||
17277 | 422 |
|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
|
423 |
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
|
424 |
|
97227ad9480c
care for non-valid classnames (spaces in name)
Claus Gittinger <cg@exept.de>
parents:
8716
diff
changeset
|
425 |
syntaxHilighting ifTrue:[ |
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
426 |
boldOn := [aStream bold]. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
427 |
boldOff := [aStream normal]. |
8765
97227ad9480c
care for non-valid classnames (spaces in name)
Claus Gittinger <cg@exept.de>
parents:
8716
diff
changeset
|
428 |
]. |
7617 | 429 |
|
430 |
fullName := FileOutNameSpaceQuerySignal query == true. |
|
431 |
owner := aClass owningClass. |
|
17277 | 432 |
namespace := aClass topNameSpace. |
7617 | 433 |
|
434 |
(showPackage and:[owner isNil]) ifTrue:[ |
|
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
435 |
pkg := aClass getPackage. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
436 |
(pkg notNil and:[pkg ~= PackageId noProjectID]) ifTrue:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
437 |
aStream nextPutAll:'"{ Package: '''. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
438 |
aStream nextPutAll:aClass package asString. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
439 |
aStream nextPutAll:''' }"'; cr; cr. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
440 |
] |
7617 | 441 |
]. |
442 |
||
16232
c561a9ff8d9f
Always file out namespace using namespace pragma, even for private classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15956
diff
changeset
|
443 |
|
c561a9ff8d9f
Always file out namespace using namespace pragma, even for private classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15956
diff
changeset
|
444 |
"/ 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
|
445 |
"/ 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
|
446 |
"/ 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
|
447 |
"/ 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
|
448 |
|
7617 | 449 |
"/ the backward compatible namespace directive is only used |
450 |
"/ for non-private classes. |
|
451 |
"/ Private classes cannot be filed into another smalltalk anyway, |
|
452 |
"/ 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
|
453 |
"/ |
c561a9ff8d9f
Always file out namespace using namespace pragma, even for private classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15956
diff
changeset
|
454 |
"/ 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
|
455 |
"/ 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
|
456 |
"/ 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
|
457 |
"/ 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
|
458 |
"/ ] |
c561a9ff8d9f
Always file out namespace using namespace pragma, even for private classes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15956
diff
changeset
|
459 |
"/ ]. |
7617 | 460 |
|
461 |
fullName ifFalse:[ |
|
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
462 |
(owner isNil or:[forceNameSpace]) ifTrue:[ |
17277 | 463 |
(namespace notNil and:[namespace ~~ Smalltalk]) ifTrue:[ |
464 |
nsName := namespace name. |
|
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
465 |
(nsName includes:$:) ifTrue:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
466 |
nsName := '''' , nsName , '''' |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
467 |
]. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
468 |
aStream nextPutAll:'"{ NameSpace: '. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
469 |
boldOn value. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
470 |
aStream nextPutAll:nsName. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
471 |
boldOff value. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
472 |
aStream nextPutAll:' }"'; cr; cr. |
17277 | 473 |
] ifFalse:[ |
474 |
"/ always write a namespace directive - even for smalltalk classes. |
|
475 |
"/ reason: the fileout might go into a big file containing multiple classes |
|
476 |
"/ in different namespaces (otherwise, the smalltalk class would later be filed into |
|
477 |
"/ the previous class's namespace) |
|
478 |
aStream nextPutAll:'"{ NameSpace: Smalltalk }"'; cr; cr. |
|
479 |
]. |
|
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
480 |
]. |
7617 | 481 |
]. |
482 |
||
483 |
"take care of nil-superclass" |
|
484 |
superclass := aClass superclass. |
|
485 |
superclass isNil ifTrue:[ |
|
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
486 |
s := 'nil' |
7617 | 487 |
] ifFalse:[ |
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
488 |
superclassNamespace := superclass nameSpace. |
9197 | 489 |
|
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
490 |
"/ be careful: if the superclasses ns is Smalltalk, |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
491 |
"/ AND this is the definition of a private class, |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
492 |
"/ 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
|
493 |
"/ exists in my owning class, |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
494 |
"/ THEN we MUST add the smalltalk-prefix. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
495 |
"/ (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
|
496 |
"/ next time) |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
497 |
(owner notNil |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
498 |
and:[ superclassNamespace == Smalltalk |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
499 |
and:[ (owner privateClassesAt:superclass name) notNil ]]) ifTrue:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
500 |
s := superclass nameWithNameSpacePrefix. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
501 |
] ifFalse:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
502 |
fullName ifTrue:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
503 |
s := superclass name. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
504 |
] ifFalse:[ |
17277 | 505 |
(namespace == superclassNamespace |
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
506 |
and:[superclass owningClass isNil]) ifTrue:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
507 |
"/ superclass is in the same namespace and not private; |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
508 |
"/ still prepend namespace prefix for private classes, |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
509 |
"/ to avoid confusing stc, which needs that information. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
510 |
"/ LATE note (AUG2002) - no longer; stc was fixed. |
7617 | 511 |
"/ owner notNil ifTrue:[ |
512 |
"/ s := superclass name |
|
513 |
"/ ] ifFalse:[ |
|
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
514 |
s := superclass nameWithoutPrefix |
7617 | 515 |
"/ ] |
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
516 |
] ifFalse:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
517 |
"/ a very special (rare) situation: |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
518 |
"/ my superclass resides in another nameSpace, |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
519 |
"/ but there is something else named like this |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
520 |
"/ to be found in my nameSpace (or a private class) |
7617 | 521 |
|
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
522 |
superNameWithoutNameSpacePrefix := superclass nameWithoutNameSpacePrefix asSymbol. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
523 |
cls := aClass privateClassesAt:superNameWithoutNameSpacePrefix. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
524 |
cls isNil ifTrue:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
525 |
(topOwner := aClass topOwningClass) isNil ifTrue:[ |
17277 | 526 |
namespace := aClass nameSpace. |
527 |
namespace notNil ifTrue:[ |
|
528 |
cls := namespace privateClassesAt:superNameWithoutNameSpacePrefix |
|
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
529 |
] ifFalse:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
530 |
"/ aClass error:'unexpected nil namespace' |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
531 |
] |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
532 |
] ifFalse:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
533 |
cls := topOwner nameSpace at:superNameWithoutNameSpacePrefix. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
534 |
] |
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 |
(cls notNil and:[cls ~~ superclass]) ifTrue:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
537 |
s := superclassNamespace name , '::' , superNameWithoutNameSpacePrefix |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
538 |
] ifFalse:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
539 |
"/ no class with that name found in my namespace ... |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
540 |
"/ if the superclass resides in Smalltalk, |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
541 |
"/ suppress prefix; otherwise, use full prefix. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
542 |
(superclassNamespace notNil |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
543 |
and:[superclassNamespace ~~ Smalltalk]) ifTrue:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
544 |
(owner notNil |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
545 |
and:[(topOwner := owner topOwningClass) notNil |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
546 |
and:[superclass topOwningClass notNil |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
547 |
and:[topOwner nameSpace == superclass topOwningClass "owningClass" nameSpace] |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
548 |
]]) ifTrue:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
549 |
s := superNameWithoutNameSpacePrefix |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
550 |
] ifFalse:[ |
17277 | 551 |
namespace == superclass topNameSpace ifTrue:[ |
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
552 |
s := superNameWithoutNameSpacePrefix |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
553 |
] ifFalse:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
554 |
s := superclass name |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
555 |
] |
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 |
] ifFalse:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
558 |
s := superNameWithoutNameSpacePrefix |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
559 |
] |
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 |
] |
7617 | 564 |
]. |
565 |
||
9175
2d009bbc418b
care for definition of a class, where the superclass
Claus Gittinger <cg@exept.de>
parents:
8765
diff
changeset
|
566 |
boldOn value. |
7617 | 567 |
aStream nextPutAll:s. "/ superclass |
9175
2d009bbc418b
care for definition of a class, where the superclass
Claus Gittinger <cg@exept.de>
parents:
8765
diff
changeset
|
568 |
boldOff value. |
7617 | 569 |
aStream space. |
570 |
aClass basicFileOutInstvarTypeKeywordOn:aStream. |
|
571 |
||
8765
97227ad9480c
care for non-valid classnames (spaces in name)
Claus Gittinger <cg@exept.de>
parents:
8716
diff
changeset
|
572 |
useStoreString := false. |
7617 | 573 |
(fullName and:[owner isNil]) ifTrue:[ |
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
574 |
nm := aClass name. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
575 |
useStoreString := true. |
8765
97227ad9480c
care for non-valid classnames (spaces in name)
Claus Gittinger <cg@exept.de>
parents:
8716
diff
changeset
|
576 |
] ifFalse:[ |
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
577 |
nm := aClass nameWithoutPrefix. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
578 |
nm isValidSmalltalkIdentifier ifFalse:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
579 |
useStoreString := true. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
580 |
]. |
8765
97227ad9480c
care for non-valid classnames (spaces in name)
Claus Gittinger <cg@exept.de>
parents:
8716
diff
changeset
|
581 |
]. |
97227ad9480c
care for non-valid classnames (spaces in name)
Claus Gittinger <cg@exept.de>
parents:
8716
diff
changeset
|
582 |
aStream nextPut:$#. |
97227ad9480c
care for non-valid classnames (spaces in name)
Claus Gittinger <cg@exept.de>
parents:
8716
diff
changeset
|
583 |
useStoreString ifTrue:[ |
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
584 |
aStream nextPutAll:''''. |
8765
97227ad9480c
care for non-valid classnames (spaces in name)
Claus Gittinger <cg@exept.de>
parents:
8716
diff
changeset
|
585 |
]. |
9175
2d009bbc418b
care for definition of a class, where the superclass
Claus Gittinger <cg@exept.de>
parents:
8765
diff
changeset
|
586 |
boldOn value. |
8765
97227ad9480c
care for non-valid classnames (spaces in name)
Claus Gittinger <cg@exept.de>
parents:
8716
diff
changeset
|
587 |
aStream nextPutAll:nm. |
9175
2d009bbc418b
care for definition of a class, where the superclass
Claus Gittinger <cg@exept.de>
parents:
8765
diff
changeset
|
588 |
boldOff value. |
8765
97227ad9480c
care for non-valid classnames (spaces in name)
Claus Gittinger <cg@exept.de>
parents:
8716
diff
changeset
|
589 |
useStoreString ifTrue:[ |
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
590 |
aStream nextPutAll:''''. |
7617 | 591 |
]. |
592 |
||
12094 | 593 |
aStream crtab. |
7617 | 594 |
aStream nextPutAll:'instanceVariableNames:'''. |
9175
2d009bbc418b
care for definition of a class, where the superclass
Claus Gittinger <cg@exept.de>
parents:
8765
diff
changeset
|
595 |
boldOn value. |
7617 | 596 |
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
|
597 |
boldOff value. |
7617 | 598 |
aStream nextPutAll:''''. |
599 |
||
600 |
aStream crtab. |
|
601 |
aStream nextPutAll:'classVariableNames:'''. |
|
9175
2d009bbc418b
care for definition of a class, where the superclass
Claus Gittinger <cg@exept.de>
parents:
8765
diff
changeset
|
602 |
boldOn value. |
7617 | 603 |
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
|
604 |
boldOff value. |
7617 | 605 |
aStream nextPutAll:''''. |
606 |
||
607 |
aStream crtab. |
|
8551 | 608 |
aStream nextPutAll:'poolDictionaries:'''. |
9175
2d009bbc418b
care for definition of a class, where the superclass
Claus Gittinger <cg@exept.de>
parents:
8765
diff
changeset
|
609 |
boldOn value. |
8551 | 610 |
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
|
611 |
boldOff value. |
8551 | 612 |
aStream nextPutAll:''''. |
7617 | 613 |
|
614 |
aStream crtab. |
|
615 |
owner isNil ifTrue:[ |
|
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
616 |
"/ a public class |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
617 |
aStream nextPutAll:'category:'. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
618 |
aClass category isNil ifTrue:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
619 |
s := '''''' |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
620 |
] ifFalse:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
621 |
s := aClass category asString storeString |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
622 |
]. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
623 |
aStream nextPutAll:s. |
7617 | 624 |
] ifFalse:[ |
12217
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
625 |
"/ a private class |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
626 |
aStream nextPutAll:'privateIn:'. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
627 |
boldOn value. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
628 |
fullName ifTrue:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
629 |
s := owner name. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
630 |
] ifFalse:[ |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
631 |
s := owner nameWithoutNameSpacePrefix. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
632 |
]. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
633 |
aStream nextPutAll:s. |
379dcf29b04a
Project noProjectId -> PackageId noProjectId
Claus Gittinger <cg@exept.de>
parents:
12149
diff
changeset
|
634 |
boldOff value. |
7617 | 635 |
]. |
636 |
aStream cr |
|
637 |
||
10739
9602cd5ad8a0
changed #basicFileOutDefinitionOf:on:withNameSpace:withPackage:syntaxHilighting:
Claus Gittinger <cg@exept.de>
parents:
10475
diff
changeset
|
638 |
"Created: / 04-01-1997 / 20:38:16 / cg" |
9602cd5ad8a0
changed #basicFileOutDefinitionOf:on:withNameSpace:withPackage:syntaxHilighting:
Claus Gittinger <cg@exept.de>
parents:
10475
diff
changeset
|
639 |
"Modified: / 18-03-1999 / 18:15:46 / stefan" |
10740 | 640 |
"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
|
641 |
"Modified: / 06-03-2014 / 10:32:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7617 | 642 |
! |
643 |
||
8277
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
644 |
fileOutClassInstVarDefinitionOn:aStream withNameSpace:withNameSpace |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
645 |
"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
|
646 |
|
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
647 |
|anySuperClassInstVar| |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
648 |
|
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
649 |
myClass isLoaded ifFalse:[ |
12094 | 650 |
^ myClass basicFileOutDefinitionOn:aStream withNameSpace:withNameSpace |
8277
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
651 |
]. |
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 |
withNameSpace ifTrue:[ |
12094 | 654 |
myClass name printOn:aStream. |
8277
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
655 |
] ifFalse:[ |
12094 | 656 |
myClass printClassNameOn:aStream. |
8277
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 |
aStream nextPutAll:' class instanceVariableNames:'''. |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
659 |
self printInstVarNamesOn:aStream indent:8. |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
660 |
aStream nextPutAll:''''. |
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 |
"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
|
663 |
|
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
664 |
anySuperClassInstVar := false. |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
665 |
myClass allSuperclassesDo:[:aSuperClass | |
12094 | 666 |
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
|
667 |
]. |
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 |
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
|
670 |
anySuperClassInstVar ifFalse:[ |
12094 | 671 |
aStream |
672 |
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
|
673 |
] ifTrue:[ |
12094 | 674 |
aStream |
675 |
nextPutLine:'The following class instance variables are inherited by this class:'. |
|
676 |
aStream cr. |
|
677 |
myClass allSuperclassesDo:[:aSuperClass | |
|
678 |
aStream tab; nextPutAll:aSuperClass name; nextPutAll:' - '. |
|
679 |
aStream nextPutLine:(aSuperClass class instanceVariableString). |
|
680 |
]. |
|
8277
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
681 |
|
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 |
aStream nextPut:(Character doubleQuote); cr. |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
684 |
|
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
685 |
"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
|
686 |
"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
|
687 |
"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
|
688 |
! |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
689 |
|
3640
523d80dfc3ac
added #fileOutDefinitionOn: (show c-instVars) for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3629
diff
changeset
|
690 |
fileOutDefinitionOn:aStream |
523d80dfc3ac
added #fileOutDefinitionOn: (show c-instVars) for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3629
diff
changeset
|
691 |
myClass fileOutClassInstVarDefinitionOn:aStream |
523d80dfc3ac
added #fileOutDefinitionOn: (show c-instVars) for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3629
diff
changeset
|
692 |
|
523d80dfc3ac
added #fileOutDefinitionOn: (show c-instVars) for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3629
diff
changeset
|
693 |
"Modified: / 21.6.1998 / 04:10:02 / cg" |
8228 | 694 |
! |
695 |
||
696 |
fileOutOn:outStreamArg withTimeStamp:stampIt withInitialize:initIt withDefinition:withDefinition methodFilter:methodFilter encoder:encoderOrNil |
|
697 |
"file out my definition and all methods onto aStream. |
|
698 |
If stampIt is true, a timeStamp comment is prepended. |
|
699 |
If initIt is true, and the class implements a class-initialize method, |
|
700 |
append a corresponding doIt expression for initialization. |
|
701 |
The order by which the fileOut is done is used to put the version string at the end. |
|
702 |
Thus, if the version string is expanded (by CVS), the characterPositions of methods should not move" |
|
703 |
||
12149
797e3911c35d
added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents:
12102
diff
changeset
|
704 |
self programmingLanguage sourceFileWriterClass new |
797e3911c35d
added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents:
12102
diff
changeset
|
705 |
fileOut:myClass on:outStreamArg withTimeStamp:stampIt |
797e3911c35d
added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents:
12102
diff
changeset
|
706 |
withInitialize:initIt withDefinition:withDefinition |
797e3911c35d
added: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents:
12102
diff
changeset
|
707 |
methodFilter:methodFilter encoder:encoderOrNil |
3640
523d80dfc3ac
added #fileOutDefinitionOn: (show c-instVars) for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3629
diff
changeset
|
708 |
! ! |
523d80dfc3ac
added #fileOutDefinitionOn: (show c-instVars) for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3629
diff
changeset
|
709 |
|
12029 | 710 |
!Metaclass methodsFor:'method templates'! |
711 |
||
712 |
versionMethodTemplateForSourceCodeManager:aSourceCodeManager |
|
713 |
^ aSourceCodeManager versionMethodTemplateForSmalltalk |
|
714 |
! ! |
|
715 |
||
12094 | 716 |
!Metaclass methodsFor:'misc ui support'! |
717 |
||
718 |
iconInBrowserSymbol |
|
719 |
"can be redefined for a private icon in the browser. |
|
720 |
The returned symbol must be a selector of the ToolbarIconLibrary." |
|
721 |
||
722 |
^ nil |
|
723 |
! ! |
|
724 |
||
1875 | 725 |
!Metaclass methodsFor:'private'! |
68 | 726 |
|
12094 | 727 |
setSoleInstance:aClass |
6021 | 728 |
myClass := aClass |
729 |
||
730 |
"Created: 12.12.1995 / 13:46:22 / cg" |
|
1 | 731 |
! ! |
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
732 |
|
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
733 |
!Metaclass methodsFor:'queries'! |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
734 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
735 |
category |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
736 |
"return my category" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
737 |
|
12094 | 738 |
myClass isNil ifTrue:[^ nil]. |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
739 |
^ myClass category |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
740 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
741 |
"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
|
742 |
! |
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 |
comment |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
745 |
"return my comment" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
746 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
747 |
^ myClass comment |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
748 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
749 |
"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
|
750 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
751 |
|
9712 | 752 |
getPackage |
753 |
"return my package-id" |
|
754 |
||
755 |
^ myClass getPackage |
|
756 |
||
757 |
"Created: 15.10.1996 / 19:44:51 / cg" |
|
758 |
! |
|
759 |
||
5574 | 760 |
hasExtensions |
761 |
"return true if I have extensions" |
|
762 |
||
763 |
^ myClass hasExtensions |
|
764 |
||
765 |
! |
|
766 |
||
5659 | 767 |
hasExtensionsFrom:aPackageID |
768 |
"return true if I have extensions from a package" |
|
769 |
||
770 |
^ myClass hasExtensionsFrom:aPackageID |
|
771 |
! |
|
772 |
||
1179
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1087
diff
changeset
|
773 |
isBuiltInClass |
1266 | 774 |
"return true if this class is known by the run-time-system. |
775 |
Here, true is returned for myself, false for subclasses." |
|
776 |
||
1179
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1087
diff
changeset
|
777 |
^ self == Metaclass class or:[self == Metaclass] |
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1087
diff
changeset
|
778 |
|
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1087
diff
changeset
|
779 |
"Created: 15.4.1996 / 17:17:34 / cg" |
1266 | 780 |
"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
|
781 |
! |
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1087
diff
changeset
|
782 |
|
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
783 |
isMeta |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
784 |
"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
|
785 |
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
|
786 |
|
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
787 |
^ true |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
788 |
! |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
789 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
790 |
name |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
791 |
"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
|
792 |
appended." |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
793 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
794 |
|nm| |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
795 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
796 |
myClass isNil ifTrue:[ |
12094 | 797 |
^ #someMetaclass |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
798 |
]. |
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 |
(nm := myClass name) isNil ifTrue:[ |
12094 | 801 |
'Metaclass [warning]: no name in my class' errorPrintCR. |
802 |
^ #'unnamed class' |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
803 |
]. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
804 |
^ nm , ' class' |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
805 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
806 |
"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
|
807 |
"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
|
808 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
809 |
|
1920 | 810 |
nameSpace |
811 |
"return the nameSpace I am contained in. |
|
812 |
Due to the implementation of nameSpaces (as classVariables), |
|
813 |
a class can only be contained in one nameSpace (which is the desired)" |
|
814 |
||
815 |
"/ this information is in the class |
|
816 |
||
817 |
^ myClass nameSpace |
|
818 |
||
819 |
"Created: 7.11.1996 / 13:18:52 / cg" |
|
820 |
! |
|
821 |
||
1724 | 822 |
owningClass |
823 |
"return nil here - regular metaclasses are never private" |
|
824 |
||
825 |
^ nil |
|
826 |
||
827 |
"Created: 12.10.1996 / 20:12:16 / cg" |
|
828 |
! |
|
829 |
||
1757 | 830 |
package |
831 |
"return my package-id" |
|
832 |
||
833 |
^ myClass package |
|
834 |
||
835 |
"Created: 15.10.1996 / 19:44:51 / cg" |
|
836 |
! |
|
837 |
||
18890 | 838 |
sharedPools |
839 |
^ myClass sharedPools |
|
840 |
! |
|
841 |
||
12094 | 842 |
soleInstance |
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
843 |
"return my sole class." |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
844 |
|
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
845 |
^ myClass |
2047 | 846 |
! |
847 |
||
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
848 |
subclasses |
12835 | 849 |
"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
|
850 |
|
12835 | 851 |
^ 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
|
852 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
853 |
" |
12835 | 854 |
Integer class subclasses |
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
855 |
" |
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 |
|
5217
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
858 |
theMetaclass |
9695 | 859 |
"return the metaClass of the class-meta pair. |
860 |
Here, return myself, because I am the metaclass. |
|
861 |
Also implemented in my class, which also returns me." |
|
5217
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
862 |
|
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
863 |
^ self |
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
864 |
|
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
865 |
"Created: / 30.1.2000 / 23:08:15 / cg" |
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
866 |
"Modified: / 31.1.2000 / 16:15:00 / cg" |
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
867 |
! |
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 |
theNonMetaclass |
9695 | 870 |
"return the nonMetaClass of the class-meta pair. |
871 |
Here, return my class object, because I am the metaclass. |
|
17592 | 872 |
Also implemented in my class, which returns itself. |
873 |
Sigh: ST/X naming; Squeak calls this theNonMetaClass" |
|
5217
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
874 |
|
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
875 |
^ self soleInstance |
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
876 |
|
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
877 |
"Created: / 30.1.2000 / 23:08:11 / cg" |
5218 | 878 |
"Modified: / 31.1.2000 / 16:17:02 / cg" |
5217
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
879 |
! |
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
880 |
|
2047 | 881 |
topOwningClass |
882 |
"return nil here - regular metaclasses are never private" |
|
883 |
||
884 |
^ nil |
|
885 |
||
886 |
"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
|
887 |
! ! |
621 | 888 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
889 |
!Metaclass methodsFor:'source management'! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
890 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
891 |
binaryRevision |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
892 |
^ myClass binaryRevision |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
893 |
|
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 |
Object binaryRevision |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
896 |
Object class binaryRevision |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
897 |
" |
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 |
"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
|
900 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
901 |
|
13475
76bd767cfcee
added: #binaryRevisionString
Claus Gittinger <cg@exept.de>
parents:
13407
diff
changeset
|
902 |
binaryRevisionString |
76bd767cfcee
added: #binaryRevisionString
Claus Gittinger <cg@exept.de>
parents:
13407
diff
changeset
|
903 |
^ myClass binaryRevisionString |
76bd767cfcee
added: #binaryRevisionString
Claus Gittinger <cg@exept.de>
parents:
13407
diff
changeset
|
904 |
|
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 |
Object binaryRevisionString |
76bd767cfcee
added: #binaryRevisionString
Claus Gittinger <cg@exept.de>
parents:
13407
diff
changeset
|
907 |
Object class binaryRevisionString |
76bd767cfcee
added: #binaryRevisionString
Claus Gittinger <cg@exept.de>
parents:
13407
diff
changeset
|
908 |
" |
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 |
"Modified: / 02-04-1997 / 01:17:04 / stefan" |
76bd767cfcee
added: #binaryRevisionString
Claus Gittinger <cg@exept.de>
parents:
13407
diff
changeset
|
911 |
"Created: / 01-07-2011 / 10:55:39 / cg" |
76bd767cfcee
added: #binaryRevisionString
Claus Gittinger <cg@exept.de>
parents:
13407
diff
changeset
|
912 |
! |
76bd767cfcee
added: #binaryRevisionString
Claus Gittinger <cg@exept.de>
parents:
13407
diff
changeset
|
913 |
|
15956 | 914 |
sourceCodeManagerFromBinaryRevision |
915 |
||
916 |
^ myClass sourceCodeManagerFromBinaryRevision |
|
917 |
||
918 |
"Modified: / 01-04-1997 / 14:36:31 / stefan" |
|
919 |
"Created: / 06-10-2011 / 09:34:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
920 |
! |
|
921 |
||
8228 | 922 |
sourceFileSuffix |
13407 | 923 |
^ self programmingLanguage sourceFileSuffix |
924 |
||
925 |
"Modified: / 15-08-2009 / 22:46:44 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
926 |
"Modified: / 28-06-2011 / 13:44:36 / cg" |
|
8228 | 927 |
! |
928 |
||
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
929 |
sourceStream |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
930 |
"return the classes source stream" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
931 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
932 |
^ myClass sourceStream |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
933 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
934 |
"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
|
935 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
936 |
|
4780 | 937 |
sourceStreamFor:sourceFileName |
938 |
"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
|
939 |
|
4780 | 940 |
^ myClass sourceStreamFor:sourceFileName |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
941 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
942 |
"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
|
943 |
! ! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
944 |
|
1742 | 945 |
!Metaclass class methodsFor:'documentation'! |
639 | 946 |
|
12102 | 947 |
version_CVS |
18890 | 948 |
^ '$Header$' |
639 | 949 |
! ! |
6824
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
950 |
|
15956 | 951 |
|
2822
64829ed8f8c6
allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
952 |
Metaclass initialize! |