author | Stefan Vogel <sv@exept.de> |
Wed, 26 Jan 2005 15:41:06 +0100 | |
changeset 8709 | 25088287bbd0 |
parent 8551 | de314b9f8fa3 |
child 8716 | 9fe96eaed619 |
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 |
" |
|
12 |
||
5341
e7465ebd9126
change notification for new classes
Claus Gittinger <cg@exept.de>
parents:
5328
diff
changeset
|
13 |
"{ Package: 'stx:libbasic' }" |
e7465ebd9126
change notification for new classes
Claus Gittinger <cg@exept.de>
parents:
5328
diff
changeset
|
14 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
15 |
ClassDescription subclass:#Metaclass |
1047 | 16 |
instanceVariableNames:'myClass' |
2822
64829ed8f8c6
allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
17 |
classVariableNames:'ConfirmationQuerySignal' |
1047 | 18 |
poolDictionaries:'' |
19 |
category:'Kernel-Classes' |
|
1 | 20 |
! |
21 |
||
1742 | 22 |
!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
|
23 |
|
88 | 24 |
copyright |
25 |
" |
|
26 |
COPYRIGHT (c) 1988 by Claus Gittinger |
|
159 | 27 |
All Rights Reserved |
1 | 28 |
|
88 | 29 |
This software is furnished under a license and may be used |
30 |
only in accordance with the terms of that license and with the |
|
31 |
inclusion of the above copyright notice. This software may not |
|
32 |
be provided or otherwise made available to, or used by, any |
|
33 |
other person. No title to or ownership of the software is |
|
34 |
hereby transferred. |
|
35 |
" |
|
621 | 36 |
! |
37 |
||
38 |
documentation |
|
39 |
" |
|
40 |
every classes class is a subclass of Metaclass. |
|
41 |
(i.e. every class is the sole instance of its Metaclass) |
|
42 |
Metaclass provides support for creating new (sub)classes and/or |
|
43 |
changing the definition of an already existing class. |
|
1292 | 44 |
|
45 |
[author:] |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
46 |
Claus Gittinger |
1669 | 47 |
|
48 |
[see also:] |
|
49 |
Behavior ClassDescription Class |
|
621 | 50 |
" |
88 | 51 |
! ! |
1 | 52 |
|
2822
64829ed8f8c6
allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
53 |
!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
|
54 |
|
64829ed8f8c6
allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
55 |
confirmationQuerySignal |
64829ed8f8c6
allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
56 |
"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
|
57 |
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
|
58 |
If unhandled, they are." |
64829ed8f8c6
allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
59 |
|
64829ed8f8c6
allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
60 |
^ ConfirmationQuerySignal |
64829ed8f8c6
allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
61 |
|
64829ed8f8c6
allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
62 |
"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
|
63 |
! ! |
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 |
!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
|
66 |
|
64829ed8f8c6
allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
67 |
initialize |
64829ed8f8c6
allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
68 |
ConfirmationQuerySignal := QuerySignal new defaultAnswer:true |
64829ed8f8c6
allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
69 |
|
64829ed8f8c6
allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
70 |
"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
|
71 |
! ! |
64829ed8f8c6
allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
72 |
|
1742 | 73 |
!Metaclass class methodsFor:'creating metaclasses'! |
356 | 74 |
|
75 |
new |
|
76 |
"creating a new metaclass - have to set the new classes |
|
77 |
flags correctly to have it behave like a metaclass ... |
|
78 |
Not for normal applications - creating new metaclasses is a very |
|
79 |
tricky thing; should be left to the gurus ;-)" |
|
80 |
||
81 |
|newMetaclass| |
|
82 |
||
83 |
newMetaclass := super new. |
|
84 |
newMetaclass instSize:(Class instSize). |
|
85 |
newMetaclass setSuperclass:Class. |
|
86 |
||
87 |
^ newMetaclass |
|
88 |
||
89 |
" |
|
90 |
Metaclass new <- new metaclass |
|
91 |
Metaclass new new <- new class |
|
92 |
Metaclass new new new <- new instance |
|
93 |
" |
|
94 |
! ! |
|
95 |
||
1742 | 96 |
!Metaclass class methodsFor:'queries'! |
1179
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1087
diff
changeset
|
97 |
|
7617 | 98 |
asPrivate |
99 |
^ PrivateMetaclass |
|
100 |
! |
|
101 |
||
1179
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1087
diff
changeset
|
102 |
isBuiltInClass |
1266 | 103 |
"return true if this class is known by the run-time-system. |
104 |
Here, true is returned for myself, false for subclasses." |
|
105 |
||
1179
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1087
diff
changeset
|
106 |
^ self == Metaclass class or:[self == Metaclass] |
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1087
diff
changeset
|
107 |
|
1266 | 108 |
"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
|
109 |
! ! |
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1087
diff
changeset
|
110 |
|
7261 | 111 |
!Metaclass methodsFor:'Compatibility-ST80'! |
3012 | 112 |
|
113 |
comment:aString |
|
114 |
"ignored - sometimes found in ST-80 fileOut files. |
|
115 |
Comments are supposed to be defined via class messages." |
|
116 |
||
117 |
"Created: 9.10.1997 / 18:14:34 / cg" |
|
3079 | 118 |
! |
119 |
||
120 |
sourceCodeTemplate |
|
121 |
"ST80 compatibility - return a definition message for myself. |
|
122 |
Same as #definition" |
|
123 |
||
124 |
^ self soleInstance definition |
|
125 |
||
126 |
"Created: / 1.11.1997 / 13:16:45 / cg" |
|
3012 | 127 |
! ! |
128 |
||
5578 | 129 |
!Metaclass methodsFor:'autoload check'! |
130 |
||
131 |
isLoaded |
|
132 |
"return true, if the class has been loaded; |
|
133 |
redefined in Autoload; see comment there" |
|
134 |
||
135 |
^ myClass isLoaded |
|
136 |
||
137 |
||
138 |
! ! |
|
139 |
||
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
140 |
!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
|
141 |
|
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
142 |
instanceVariableNames:aString |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
143 |
"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
|
144 |
this actually creates a new metaclass and class, leaving the original |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
145 |
classes around as obsolete classes. This may also be true for all subclasses, |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
146 |
if class instance variables are added/removed. |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
147 |
Existing instances continue to be defined by their original classes. |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
148 |
|
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
149 |
Time will show, if this is an acceptable behavior or if we should migrate |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
150 |
instances to become insts. of the new classes." |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
151 |
|
6021 | 152 |
|builder| |
153 |
||
7518
298576c9de5a
care for no real change in instanceVariableString.
Claus Gittinger <cg@exept.de>
parents:
7435
diff
changeset
|
154 |
self instanceVariableString asStringCollection = aString asStringCollection ifTrue:[^ self]. |
298576c9de5a
care for no real change in instanceVariableString.
Claus Gittinger <cg@exept.de>
parents:
7435
diff
changeset
|
155 |
|
6021 | 156 |
builder := ClassBuilder new. |
157 |
builder oldMetaclass:self instanceVariableNames:aString. |
|
158 |
builder rebuildForChangedInstanceVariables. |
|
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
159 |
! ! |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
160 |
|
5994
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
161 |
!Metaclass methodsFor:'compiler interface'! |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
162 |
|
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
163 |
browserClass |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
164 |
"return the browser to use for this class - |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
165 |
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
|
166 |
|
6021 | 167 |
^ UserPreferences systemBrowserClass. |
5994
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
168 |
|
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
169 |
"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
|
170 |
! |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
171 |
|
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
172 |
compilerClass |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
173 |
"return the compiler to use for this class - |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
174 |
this can be redefined in special classes, to compile classes with |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
175 |
Lisp, Prolog, ASN1, Basic :-) or whatever syntax." |
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 |
^ Compiler |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
178 |
! |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
179 |
|
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
180 |
evaluatorClass |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
181 |
"return the compiler to use for expression evaluation for this class - |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
182 |
this can be redefined in special classes, to evaluate expressions with |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
183 |
Lisp, Prolog, ASN1, Basic :-) or whatever syntax." |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
184 |
|
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
185 |
^ Compiler |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
186 |
! |
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 |
formatterClass |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
189 |
"return the parser to use for formatting (prettyPrinting) this class - |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
190 |
this can be redefined in special classes, to format classes with |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
191 |
Lisp, Prolog, ASN1, Basic :-) or whatever syntax." |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
192 |
|
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
193 |
^ Parser |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
194 |
|
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
195 |
"Created: / 27.4.1998 / 15:33:34 / cg" |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
196 |
! |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
197 |
|
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
198 |
parserClass |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
199 |
"return the parser to use for parsing this class - |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
200 |
this can be redefined in special classes, to parse classes with |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
201 |
Lisp, Prolog, ASN1, Basic :-) or whatever syntax." |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
202 |
|
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
203 |
^ Parser |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
204 |
|
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
205 |
"Created: 18.4.1997 / 21:02:41 / cg" |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
206 |
! |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
207 |
|
7617 | 208 |
realSubclassDefinerClass |
209 |
^ self evaluatorClass |
|
210 |
! |
|
211 |
||
5994
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
212 |
subclassDefinerClass |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
213 |
"Answer an evaluator class appropriate for evaluating definitions of new |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
214 |
subclasses of this class." |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
215 |
|
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
216 |
^ self evaluatorClass |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
217 |
|
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
218 |
|
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
219 |
! |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
220 |
|
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
221 |
syntaxHighlighterClass |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
222 |
"return the class to use for syntaxHighlighting (prettyPrinting) this class - |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
223 |
this can be redefined in special classes, to highlight classes with |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
224 |
Lisp, Prolog, ASN1, Basic :-) or whatever syntax." |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
225 |
|
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
226 |
^ SyntaxHighlighter |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
227 |
|
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
228 |
"Created: / 27.4.1998 / 15:34:08 / cg" |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
229 |
! ! |
554530710162
allow metaclass to specify compiler, parser, evaluator etc.
Claus Gittinger <cg@exept.de>
parents:
5891
diff
changeset
|
230 |
|
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
231 |
!Metaclass methodsFor:'copying'! |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
232 |
|
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
233 |
postCopy |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
234 |
"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
|
235 |
|
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
236 |
myClass := nil |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
237 |
! ! |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
238 |
|
1 | 239 |
!Metaclass methodsFor:'creating classes'! |
240 |
||
6824
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
241 |
name:newName inEnvironment:aSystemDictionary |
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
242 |
subclassOf:aClass |
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
243 |
instanceVariableNames:stringOfInstVarNames |
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
244 |
variable:variableBoolean |
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
245 |
words:wordsBoolean |
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
246 |
pointers:pointersBoolean |
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
247 |
classVariableNames:stringOfClassVarNames |
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
248 |
poolDictionaries:stringOfPoolNames |
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
249 |
category:categoryString |
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
250 |
comment:commentString |
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
251 |
changed:changed |
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
252 |
|
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
253 |
^ self |
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
254 |
name:newName |
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
255 |
inEnvironment:aSystemDictionary |
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
256 |
subclassOf:aClass |
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
257 |
instanceVariableNames:stringOfInstVarNames |
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
258 |
variable:variableBoolean |
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
259 |
words:wordsBoolean |
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
260 |
pointers:pointersBoolean |
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
261 |
classVariableNames:stringOfClassVarNames |
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
262 |
poolDictionaries:stringOfPoolNames |
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
263 |
category:categoryString |
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
264 |
comment:commentString |
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
265 |
changed:changed |
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
266 |
classInstanceVariableNames:nil |
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
267 |
|
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
268 |
"Modified: 16.6.1997 / 11:53:58 / cg" |
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
269 |
! |
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
270 |
|
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
271 |
name:newName inEnvironment:aSystemDictionaryOrClass |
2668
fb4a2e42a60d
Metaclass no longer responds to #category:
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
272 |
subclassOf:aClass |
fb4a2e42a60d
Metaclass no longer responds to #category:
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
273 |
instanceVariableNames:stringOfInstVarNames |
fb4a2e42a60d
Metaclass no longer responds to #category:
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
274 |
variable:variableBoolean |
fb4a2e42a60d
Metaclass no longer responds to #category:
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
275 |
words:wordsBoolean |
fb4a2e42a60d
Metaclass no longer responds to #category:
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
276 |
pointers:pointersBoolean |
fb4a2e42a60d
Metaclass no longer responds to #category:
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
277 |
classVariableNames:stringOfClassVarNames |
fb4a2e42a60d
Metaclass no longer responds to #category:
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
278 |
poolDictionaries:stringOfPoolNames |
fb4a2e42a60d
Metaclass no longer responds to #category:
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
279 |
category:categoryString |
fb4a2e42a60d
Metaclass no longer responds to #category:
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
280 |
comment:commentString |
fb4a2e42a60d
Metaclass no longer responds to #category:
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
281 |
changed:changed |
2688
a7777c381e7e
care for classInstVars when redefining superclass
Claus Gittinger <cg@exept.de>
parents:
2687
diff
changeset
|
282 |
classInstanceVariableNames:stringOfClassInstVarNamesOrNil |
1439 | 283 |
|
284 |
"this is the main workhorse for installing new classes - special care |
|
285 |
has to be taken, when changing an existing classes definition. In this |
|
286 |
case, some or all of the methods and subclasses methods have to be |
|
287 |
recompiled. |
|
288 |
Also, the old class(es) are still kept (but not accessable as a global), |
|
289 |
to allow existing instances some life. |
|
290 |
This might change in the future. |
|
291 |
" |
|
6021 | 292 |
|builder| |
293 |
||
6516
68fdff63c92b
allow for classBuilder to be provided by subclasses
Claus Gittinger <cg@exept.de>
parents:
6082
diff
changeset
|
294 |
builder := self newClassBuilder. |
6021 | 295 |
builder name:newName |
6824
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
296 |
inEnvironment:aSystemDictionaryOrClass |
6021 | 297 |
subclassOf:aClass |
298 |
instanceVariableNames:stringOfInstVarNames |
|
299 |
variable:variableBoolean |
|
300 |
words:wordsBoolean |
|
301 |
pointers:pointersBoolean |
|
302 |
classVariableNames:stringOfClassVarNames |
|
303 |
poolDictionaries:stringOfPoolNames |
|
304 |
category:categoryString |
|
305 |
comment:commentString |
|
306 |
changed:changed |
|
307 |
classInstanceVariableNames:stringOfClassInstVarNamesOrNil. |
|
308 |
^ builder buildClass. |
|
309 |
! |
|
310 |
||
311 |
new |
|
312 |
"create & return a new metaclass (a classes class). |
|
313 |
Since metaclasses only have one instance (the class), |
|
314 |
complain if there is already one. |
|
315 |
You get a new class by sending #new to the returned metaclass |
|
316 |
(confusing - isn't it ?)" |
|
317 |
||
318 |
|newClass| |
|
319 |
||
320 |
myClass notNil ifTrue:[ |
|
321 |
self error:'Each metaclass may only have one instance'. |
|
322 |
]. |
|
323 |
newClass := self basicNew. |
|
324 |
newClass |
|
325 |
setSuperclass:Object |
|
326 |
methodDictionary:(MethodDictionary new) |
|
327 |
instSize:0 |
|
328 |
flags:(Behavior flagBehavior). |
|
329 |
myClass := newClass. |
|
330 |
^ newClass |
|
331 |
||
332 |
"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
|
333 |
! |
68fdff63c92b
allow for classBuilder to be provided by subclasses
Claus Gittinger <cg@exept.de>
parents:
6082
diff
changeset
|
334 |
|
68fdff63c92b
allow for classBuilder to be provided by subclasses
Claus Gittinger <cg@exept.de>
parents:
6082
diff
changeset
|
335 |
newClassBuilder |
7617 | 336 |
^ ClassBuilder new metaclass:self class. |
1 | 337 |
! ! |
338 |
||
5562 | 339 |
!Metaclass methodsFor:'enumerating'! |
340 |
||
6078
13d651d69246
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
6021
diff
changeset
|
341 |
instAndClassSelectorsAndMethodsDo:aTwoArgBlock |
13d651d69246
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
6021
diff
changeset
|
342 |
myClass instAndClassSelectorsAndMethodsDo:aTwoArgBlock |
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
343 |
! |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
344 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
345 |
subclassesDo:aBlock |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
346 |
"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
|
347 |
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
|
348 |
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
|
349 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
350 |
"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
|
351 |
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
|
352 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
353 |
self soleInstance subclassesDo:[:aSubClass | |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
354 |
aBlock value:aSubClass class |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
355 |
]. |
5562 | 356 |
! ! |
357 |
||
3640
523d80dfc3ac
added #fileOutDefinitionOn: (show c-instVars) for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3629
diff
changeset
|
358 |
!Metaclass methodsFor:'fileOut'! |
523d80dfc3ac
added #fileOutDefinitionOn: (show c-instVars) for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3629
diff
changeset
|
359 |
|
7617 | 360 |
basicFileOutDefinitionOf:aClass on:aStream withNameSpace:forceNameSpace withPackage:showPackage |
361 |
"append an expression on aStream, which defines myself." |
|
362 |
||
363 |
|s owner ns nsName fullName forceNoNameSpace superNameWithoutNameSpacePrefix cls topOwner |
|
364 |
syntaxHilighting superclass superclassNamespace| |
|
365 |
||
366 |
UserPreferences isNil ifTrue:[ |
|
367 |
syntaxHilighting := false |
|
368 |
] ifFalse:[ |
|
369 |
syntaxHilighting := UserPreferences current syntaxColoring. |
|
370 |
]. |
|
371 |
||
372 |
fullName := FileOutNameSpaceQuerySignal query == true. |
|
373 |
owner := aClass owningClass. |
|
374 |
ns := aClass topNameSpace. |
|
375 |
||
376 |
(showPackage and:[owner isNil]) ifTrue:[ |
|
377 |
aStream nextPutAll:'"{ Package: '''. |
|
378 |
aStream nextPutAll:aClass package asString. |
|
379 |
aStream nextPutAll:''' }"'; cr; cr. |
|
380 |
]. |
|
381 |
||
382 |
"/ the backward compatible namespace directive is only used |
|
383 |
"/ for non-private classes. |
|
384 |
"/ Private classes cannot be filed into another smalltalk anyway, |
|
385 |
"/ and there is no need to complicate global lookup in stc... |
|
386 |
||
387 |
owner notNil ifTrue:[ |
|
388 |
forceNoNameSpace := ForceNoNameSpaceQuerySignal query == true. |
|
389 |
forceNoNameSpace ifFalse:[ |
|
390 |
fullName := true. |
|
391 |
] |
|
392 |
]. |
|
393 |
||
394 |
fullName ifFalse:[ |
|
395 |
(owner isNil or:[forceNameSpace]) ifTrue:[ |
|
396 |
(ns notNil and:[ns ~~ Smalltalk]) ifTrue:[ |
|
397 |
nsName := ns name. |
|
398 |
(nsName includes:$:) ifTrue:[ |
|
399 |
nsName := '''' , nsName , '''' |
|
400 |
]. |
|
401 |
aStream nextPutAll:'"{ NameSpace: '. |
|
402 |
syntaxHilighting ifTrue:[aStream bold]. |
|
403 |
aStream nextPutAll:nsName. |
|
404 |
syntaxHilighting ifTrue:[aStream normal]. |
|
405 |
aStream nextPutAll:' }"'; cr; cr. |
|
406 |
] |
|
407 |
]. |
|
408 |
]. |
|
409 |
||
410 |
"take care of nil-superclass" |
|
411 |
superclass := aClass superclass. |
|
412 |
superclass isNil ifTrue:[ |
|
413 |
s := 'nil' |
|
414 |
] ifFalse:[ |
|
415 |
superclassNamespace := superclass nameSpace. |
|
416 |
||
417 |
fullName ifTrue:[ |
|
418 |
s := superclass name. |
|
419 |
] ifFalse:[ |
|
420 |
(ns == superclassNamespace |
|
421 |
and:[superclass owningClass isNil]) ifTrue:[ |
|
422 |
"/ superclass is in the same namespace and not private; |
|
423 |
"/ still prepend namespace prefix for private classes, |
|
424 |
"/ to avoid confusing stc, which needs that information. |
|
425 |
"/ LATE note (AUG2002) - no longer; stc was fixed. |
|
426 |
"/ owner notNil ifTrue:[ |
|
427 |
"/ s := superclass name |
|
428 |
"/ ] ifFalse:[ |
|
429 |
s := superclass nameWithoutPrefix |
|
430 |
"/ ] |
|
431 |
] ifFalse:[ |
|
432 |
"/ a very special (rare) situation: |
|
433 |
"/ my superclass resides in another nameSpace, |
|
434 |
"/ but there is something else named like this |
|
435 |
"/ to be found in my nameSpace (or a private class) |
|
436 |
||
437 |
superNameWithoutNameSpacePrefix := superclass nameWithoutNameSpacePrefix asSymbol. |
|
438 |
cls := aClass privateClassesAt:superNameWithoutNameSpacePrefix. |
|
439 |
cls isNil ifTrue:[ |
|
440 |
(topOwner := aClass topOwningClass) isNil ifTrue:[ |
|
441 |
ns := aClass nameSpace. |
|
442 |
ns notNil ifTrue:[ |
|
443 |
cls := ns privateClassesAt:superNameWithoutNameSpacePrefix |
|
444 |
] ifFalse:[ |
|
445 |
"/ aClass error:'unexpected nil namespace' |
|
446 |
] |
|
447 |
] ifFalse:[ |
|
448 |
cls := topOwner nameSpace at:superNameWithoutNameSpacePrefix. |
|
449 |
] |
|
450 |
]. |
|
451 |
(cls notNil and:[cls ~~ superclass]) ifTrue:[ |
|
452 |
s := superclassNamespace name , '::' , superNameWithoutNameSpacePrefix |
|
453 |
] ifFalse:[ |
|
454 |
"/ no class with that name found in my namespace ... |
|
455 |
"/ if the superclass resides in Smalltalk, |
|
456 |
"/ suppress prefix; otherwise, use full prefix. |
|
457 |
(superclassNamespace notNil |
|
458 |
and:[superclassNamespace ~~ Smalltalk]) ifTrue:[ |
|
459 |
(owner notNil |
|
460 |
and:[(topOwner := owner topOwningClass) notNil |
|
461 |
and:[topOwner nameSpace == superclass topOwningClass "owningClass" nameSpace |
|
462 |
]]) ifTrue:[ |
|
463 |
s := superNameWithoutNameSpacePrefix |
|
464 |
] ifFalse:[ |
|
465 |
ns == superclass topNameSpace ifTrue:[ |
|
466 |
s := superNameWithoutNameSpacePrefix |
|
467 |
] ifFalse:[ |
|
468 |
s := superclass name |
|
469 |
] |
|
470 |
] |
|
471 |
] ifFalse:[ |
|
472 |
s := superNameWithoutNameSpacePrefix |
|
473 |
] |
|
474 |
] |
|
475 |
] |
|
476 |
] |
|
477 |
]. |
|
478 |
||
479 |
syntaxHilighting ifTrue:[aStream bold]. |
|
480 |
aStream nextPutAll:s. "/ superclass |
|
481 |
syntaxHilighting ifTrue:[aStream normal]. |
|
482 |
aStream space. |
|
483 |
aClass basicFileOutInstvarTypeKeywordOn:aStream. |
|
484 |
||
485 |
(fullName and:[owner isNil]) ifTrue:[ |
|
486 |
aStream nextPutAll:'#'''. |
|
487 |
syntaxHilighting ifTrue:[aStream bold]. |
|
488 |
aStream nextPutAll:(aClass name). |
|
489 |
syntaxHilighting ifTrue:[aStream normal]. |
|
490 |
aStream nextPutAll:''''. |
|
491 |
] ifFalse:[ |
|
492 |
aStream nextPut:$#. |
|
493 |
syntaxHilighting ifTrue:[aStream bold]. |
|
494 |
aStream nextPutAll:(aClass nameWithoutPrefix). |
|
495 |
syntaxHilighting ifTrue:[aStream normal]. |
|
496 |
]. |
|
497 |
||
498 |
aStream crtab. |
|
499 |
aStream nextPutAll:'instanceVariableNames:'''. |
|
500 |
syntaxHilighting ifTrue:[aStream bold]. |
|
501 |
aClass printInstVarNamesOn:aStream indent:16. |
|
502 |
syntaxHilighting ifTrue:[aStream normal]. |
|
503 |
aStream nextPutAll:''''. |
|
504 |
||
505 |
aStream crtab. |
|
506 |
aStream nextPutAll:'classVariableNames:'''. |
|
507 |
syntaxHilighting ifTrue:[aStream bold]. |
|
508 |
aClass printClassVarNamesOn:aStream indent:16. |
|
509 |
syntaxHilighting ifTrue:[aStream normal]. |
|
510 |
aStream nextPutAll:''''. |
|
511 |
||
512 |
aStream crtab. |
|
8551 | 513 |
aStream nextPutAll:'poolDictionaries:'''. |
514 |
syntaxHilighting ifTrue:[aStream bold]. |
|
515 |
aClass printSharedPoolNamesOn:aStream indent:16. |
|
516 |
syntaxHilighting ifTrue:[aStream normal]. |
|
517 |
aStream nextPutAll:''''. |
|
7617 | 518 |
|
519 |
aStream crtab. |
|
520 |
owner isNil ifTrue:[ |
|
521 |
"/ a public class |
|
522 |
aStream nextPutAll:'category:'. |
|
523 |
aClass category isNil ifTrue:[ |
|
524 |
s := '''''' |
|
525 |
] ifFalse:[ |
|
526 |
s := aClass category asString storeString |
|
527 |
]. |
|
528 |
aStream nextPutAll:s. |
|
529 |
] ifFalse:[ |
|
530 |
"/ a private class |
|
531 |
aStream nextPutAll:'privateIn:'. |
|
532 |
syntaxHilighting ifTrue:[aStream bold]. |
|
533 |
fullName ifTrue:[ |
|
534 |
s := owner name. |
|
535 |
] ifFalse:[ |
|
536 |
s := owner nameWithoutNameSpacePrefix. |
|
537 |
]. |
|
538 |
aStream nextPutAll:s. |
|
539 |
syntaxHilighting ifTrue:[aStream normal]. |
|
540 |
]. |
|
541 |
aStream cr |
|
542 |
||
543 |
"Created: / 4.1.1997 / 20:38:16 / cg" |
|
544 |
"Modified: / 8.8.1997 / 10:59:50 / cg" |
|
545 |
"Modified: / 18.3.1999 / 18:15:46 / stefan" |
|
546 |
! |
|
547 |
||
8277
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
548 |
fileOutClassInstVarDefinitionOn:aStream withNameSpace:withNameSpace |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
549 |
"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
|
550 |
|
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
551 |
|anySuperClassInstVar| |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
552 |
|
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
553 |
myClass isLoaded ifFalse:[ |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
554 |
^ myClass basicFileOutDefinitionOn:aStream withNameSpace:withNameSpace |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
555 |
]. |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
556 |
|
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
557 |
withNameSpace ifTrue:[ |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
558 |
myClass name printOn:aStream. |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
559 |
] ifFalse:[ |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
560 |
myClass printClassNameOn:aStream. |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
561 |
]. |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
562 |
aStream nextPutAll:' class instanceVariableNames:'''. |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
563 |
self printInstVarNamesOn:aStream indent:8. |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
564 |
aStream nextPutAll:''''. |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
565 |
|
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
566 |
"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
|
567 |
|
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
568 |
anySuperClassInstVar := false. |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
569 |
myClass allSuperclassesDo:[:aSuperClass | |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
570 |
aSuperClass class instVarNames do:[:ignored | anySuperClassInstVar := true]. |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
571 |
]. |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
572 |
|
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
573 |
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
|
574 |
anySuperClassInstVar ifFalse:[ |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
575 |
aStream |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
576 |
nextPutLine:'No other class instance variables are inherited by this class.'. |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
577 |
] ifTrue:[ |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
578 |
aStream |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
579 |
nextPutLine:'The following class instance variables are inherited by this class:'. |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
580 |
aStream cr. |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
581 |
myClass allSuperclassesDo:[:aSuperClass | |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
582 |
aStream tab; nextPutAll:aSuperClass name; nextPutAll:' - '. |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
583 |
aStream nextPutLine:(aSuperClass class instanceVariableString). |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
584 |
]. |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
585 |
|
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
586 |
]. |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
587 |
aStream nextPut:(Character doubleQuote); cr. |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
588 |
|
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
589 |
"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
|
590 |
"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
|
591 |
"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
|
592 |
! |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8228
diff
changeset
|
593 |
|
3640
523d80dfc3ac
added #fileOutDefinitionOn: (show c-instVars) for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3629
diff
changeset
|
594 |
fileOutDefinitionOn:aStream |
523d80dfc3ac
added #fileOutDefinitionOn: (show c-instVars) for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3629
diff
changeset
|
595 |
myClass fileOutClassInstVarDefinitionOn:aStream |
523d80dfc3ac
added #fileOutDefinitionOn: (show c-instVars) for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3629
diff
changeset
|
596 |
|
523d80dfc3ac
added #fileOutDefinitionOn: (show c-instVars) for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3629
diff
changeset
|
597 |
"Modified: / 21.6.1998 / 04:10:02 / cg" |
8228 | 598 |
! |
599 |
||
600 |
fileOutOn:outStreamArg withTimeStamp:stampIt withInitialize:initIt withDefinition:withDefinition methodFilter:methodFilter encoder:encoderOrNil |
|
601 |
"file out my definition and all methods onto aStream. |
|
602 |
If stampIt is true, a timeStamp comment is prepended. |
|
603 |
If initIt is true, and the class implements a class-initialize method, |
|
604 |
append a corresponding doIt expression for initialization. |
|
605 |
The order by which the fileOut is done is used to put the version string at the end. |
|
606 |
Thus, if the version string is expanded (by CVS), the characterPositions of methods should not move" |
|
607 |
||
608 |
SmalltalkChunkFileSourceWriter new |
|
609 |
fileOut:myClass on:outStreamArg withTimeStamp:stampIt |
|
610 |
withInitialize:initIt withDefinition:withDefinition |
|
611 |
methodFilter:methodFilter encoder:encoderOrNil |
|
3640
523d80dfc3ac
added #fileOutDefinitionOn: (show c-instVars) for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3629
diff
changeset
|
612 |
! ! |
523d80dfc3ac
added #fileOutDefinitionOn: (show c-instVars) for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3629
diff
changeset
|
613 |
|
1875 | 614 |
!Metaclass methodsFor:'private'! |
68 | 615 |
|
6021 | 616 |
setSoleInstance:aClass |
617 |
myClass := aClass |
|
618 |
||
619 |
"Created: 12.12.1995 / 13:46:22 / cg" |
|
1 | 620 |
! ! |
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
621 |
|
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
622 |
!Metaclass methodsFor:'queries'! |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
623 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
624 |
category |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
625 |
"return my category" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
626 |
|
7617 | 627 |
myClass isNil ifTrue:[^ nil]. |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
628 |
^ myClass category |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
629 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
630 |
"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
|
631 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
632 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
633 |
comment |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
634 |
"return my comment" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
635 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
636 |
^ myClass comment |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
637 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
638 |
"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
|
639 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
640 |
|
5574 | 641 |
hasExtensions |
642 |
"return true if I have extensions" |
|
643 |
||
644 |
^ myClass hasExtensions |
|
645 |
||
646 |
! |
|
647 |
||
5659 | 648 |
hasExtensionsFrom:aPackageID |
649 |
"return true if I have extensions from a package" |
|
650 |
||
651 |
^ myClass hasExtensionsFrom:aPackageID |
|
652 |
! |
|
653 |
||
1179
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1087
diff
changeset
|
654 |
isBuiltInClass |
1266 | 655 |
"return true if this class is known by the run-time-system. |
656 |
Here, true is returned for myself, false for subclasses." |
|
657 |
||
1179
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1087
diff
changeset
|
658 |
^ self == Metaclass class or:[self == Metaclass] |
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1087
diff
changeset
|
659 |
|
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1087
diff
changeset
|
660 |
"Created: 15.4.1996 / 17:17:34 / cg" |
1266 | 661 |
"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
|
662 |
! |
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1087
diff
changeset
|
663 |
|
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
664 |
isMeta |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
665 |
"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
|
666 |
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
|
667 |
|
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
668 |
^ true |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
669 |
! |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
670 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
671 |
name |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
672 |
"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
|
673 |
appended." |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
674 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
675 |
|nm| |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
676 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
677 |
myClass isNil ifTrue:[ |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
678 |
^ #someMetaclass |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
679 |
]. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
680 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
681 |
(nm := myClass name) isNil ifTrue:[ |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
682 |
'Metaclass [warning]: no name in my class' errorPrintCR. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
683 |
^ #'unnamed class' |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
684 |
]. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
685 |
^ nm , ' class' |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
686 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
687 |
"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
|
688 |
"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
|
689 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
690 |
|
1920 | 691 |
nameSpace |
692 |
"return the nameSpace I am contained in. |
|
693 |
Due to the implementation of nameSpaces (as classVariables), |
|
694 |
a class can only be contained in one nameSpace (which is the desired)" |
|
695 |
||
696 |
"/ this information is in the class |
|
697 |
||
698 |
^ myClass nameSpace |
|
699 |
||
700 |
"Created: 7.11.1996 / 13:18:52 / cg" |
|
701 |
! |
|
702 |
||
1724 | 703 |
owningClass |
704 |
"return nil here - regular metaclasses are never private" |
|
705 |
||
706 |
^ nil |
|
707 |
||
708 |
"Created: 12.10.1996 / 20:12:16 / cg" |
|
709 |
! |
|
710 |
||
1757 | 711 |
package |
712 |
"return my package-id" |
|
713 |
||
714 |
^ myClass package |
|
715 |
||
716 |
"Created: 15.10.1996 / 19:44:51 / cg" |
|
717 |
! |
|
718 |
||
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
719 |
soleInstance |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
720 |
"return my sole class." |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
721 |
|
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
722 |
^ myClass |
2047 | 723 |
! |
724 |
||
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
725 |
subclasses |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
726 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
727 |
^ myClass subclasses collect:[:theNonMetaClass| theNonMetaClass class]. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
728 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
729 |
" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
730 |
Integer class subclasses |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
731 |
" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
732 |
! |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7261
diff
changeset
|
733 |
|
5217
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
734 |
theMetaclass |
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
735 |
"return myself; also implemented in my class object, which also returns me." |
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
736 |
|
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
737 |
^ self |
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
738 |
|
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
739 |
"Created: / 30.1.2000 / 23:08:15 / cg" |
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
740 |
"Modified: / 31.1.2000 / 16:15:00 / cg" |
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
741 |
! |
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
742 |
|
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
743 |
theNonMetaclass |
5218 | 744 |
"return my class object, also implemented in my class object, which also returns iteself." |
5217
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
745 |
|
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
746 |
^ self soleInstance |
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
747 |
|
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
748 |
"Created: / 30.1.2000 / 23:08:11 / cg" |
5218 | 749 |
"Modified: / 31.1.2000 / 16:17:02 / cg" |
5217
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
750 |
! |
3f9682e47725
added #theNonMetaclass & #theMetaclass,
Claus Gittinger <cg@exept.de>
parents:
5191
diff
changeset
|
751 |
|
2047 | 752 |
topOwningClass |
753 |
"return nil here - regular metaclasses are never private" |
|
754 |
||
755 |
^ nil |
|
756 |
||
757 |
"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
|
758 |
! ! |
621 | 759 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
760 |
!Metaclass methodsFor:'source management'! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
761 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
762 |
binaryRevision |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
763 |
^ myClass binaryRevision |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
764 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
765 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
766 |
Object binaryRevision |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
767 |
Object class binaryRevision |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
768 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
769 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
770 |
"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
|
771 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
772 |
|
8228 | 773 |
sourceFileSuffix |
774 |
^ 'st' |
|
775 |
! |
|
776 |
||
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
777 |
sourceStream |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
778 |
"return the classes source stream" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
779 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
780 |
^ myClass sourceStream |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
781 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
782 |
"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
|
783 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
784 |
|
4780 | 785 |
sourceStreamFor:sourceFileName |
786 |
"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
|
787 |
|
4780 | 788 |
^ myClass sourceStreamFor:sourceFileName |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
789 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
790 |
"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
|
791 |
! ! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2584
diff
changeset
|
792 |
|
1742 | 793 |
!Metaclass class methodsFor:'documentation'! |
639 | 794 |
|
795 |
version |
|
8551 | 796 |
^ '$Header: /cvs/stx/stx/libbasic/Metaclass.st,v 1.190 2004-09-20 08:47:54 ca Exp $' |
639 | 797 |
! ! |
6824
6fbe85d05646
...in:... -> ...inEnvironment:...
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
798 |
|
2822
64829ed8f8c6
allow for conventions-dialog to be suppressed (offer a querySignal)
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
799 |
Metaclass initialize! |