author | Stefan Vogel <sv@exept.de> |
Thu, 16 Apr 2020 16:57:05 +0200 | |
changeset 25362 | f1606835f9fb |
parent 25295 | 7067a6ee0f20 |
permissions | -rw-r--r-- |
25178 | 1 |
"{ Encoding: utf8 }" |
2 |
||
1 | 3 |
" |
4 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
155 | 5 |
All Rights Reserved |
1 | 6 |
|
7 |
This software is furnished under a license and may be used |
|
8 |
only in accordance with the terms of that license and with the |
|
9 |
inclusion of the above copyright notice. This software may not |
|
10 |
be provided or otherwise made available to, or used by, any |
|
11 |
other person. No title to or ownership of the software is |
|
12 |
hereby transferred. |
|
13 |
" |
|
5346 | 14 |
"{ Package: 'stx:libbasic' }" |
15 |
||
17296 | 16 |
"{ NameSpace: Smalltalk }" |
17 |
||
1 | 18 |
Behavior subclass:#ClassDescription |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
19 |
instanceVariableNames:'instvars' |
22811 | 20 |
classVariableNames:'CatchClassRedefinitions CatchMethodRedefinitions |
21 |
ChangeDefaultApplicationNotificationSignal ChangeFileAccessLock |
|
22 |
ClassCategoryQuerySignal |
|
23 |
ClassConventionViolationConfirmationQuerySignal |
|
24 |
CreateNameSpaceQuerySignal DefaultApplicationQuerySignal |
|
25 |
FileOutErrorSignal FileOutNameSpaceQuerySignal |
|
26 |
ForceNoNameSpaceQuerySignal LockChangesFile MethodHistory |
|
27 |
MethodHistorySize NameSpaceQuerySignal PackageQuerySignal |
|
28 |
TryLocalSourceFirst UpdateChangeFileQuerySignal |
|
29 |
UpdateChangeListQuerySignal UpdateHistoryLineQuerySignal |
|
30 |
UpdatingChanges UsedNameSpaceQuerySignal' |
|
1091 | 31 |
poolDictionaries:'' |
32 |
category:'Kernel-Classes' |
|
1 | 33 |
! |
34 |
||
4604
a08bfac91f07
migrated redefinitionSignals to new exception scheme
Claus Gittinger <cg@exept.de>
parents:
4358
diff
changeset
|
35 |
Notification subclass:#PackageRedefinition |
a08bfac91f07
migrated redefinitionSignals to new exception scheme
Claus Gittinger <cg@exept.de>
parents:
4358
diff
changeset
|
36 |
instanceVariableNames:'' |
a08bfac91f07
migrated redefinitionSignals to new exception scheme
Claus Gittinger <cg@exept.de>
parents:
4358
diff
changeset
|
37 |
classVariableNames:'' |
a08bfac91f07
migrated redefinitionSignals to new exception scheme
Claus Gittinger <cg@exept.de>
parents:
4358
diff
changeset
|
38 |
poolDictionaries:'' |
a08bfac91f07
migrated redefinitionSignals to new exception scheme
Claus Gittinger <cg@exept.de>
parents:
4358
diff
changeset
|
39 |
privateIn:ClassDescription |
a08bfac91f07
migrated redefinitionSignals to new exception scheme
Claus Gittinger <cg@exept.de>
parents:
4358
diff
changeset
|
40 |
! |
a08bfac91f07
migrated redefinitionSignals to new exception scheme
Claus Gittinger <cg@exept.de>
parents:
4358
diff
changeset
|
41 |
|
5750
4b3eae08b84b
preserve method-packages when recompiling
Claus Gittinger <cg@exept.de>
parents:
5725
diff
changeset
|
42 |
ClassDescription::PackageRedefinition subclass:#MethodRedefinitionNotification |
4604
a08bfac91f07
migrated redefinitionSignals to new exception scheme
Claus Gittinger <cg@exept.de>
parents:
4358
diff
changeset
|
43 |
instanceVariableNames:'' |
a08bfac91f07
migrated redefinitionSignals to new exception scheme
Claus Gittinger <cg@exept.de>
parents:
4358
diff
changeset
|
44 |
classVariableNames:'' |
a08bfac91f07
migrated redefinitionSignals to new exception scheme
Claus Gittinger <cg@exept.de>
parents:
4358
diff
changeset
|
45 |
poolDictionaries:'' |
a08bfac91f07
migrated redefinitionSignals to new exception scheme
Claus Gittinger <cg@exept.de>
parents:
4358
diff
changeset
|
46 |
privateIn:ClassDescription |
a08bfac91f07
migrated redefinitionSignals to new exception scheme
Claus Gittinger <cg@exept.de>
parents:
4358
diff
changeset
|
47 |
! |
a08bfac91f07
migrated redefinitionSignals to new exception scheme
Claus Gittinger <cg@exept.de>
parents:
4358
diff
changeset
|
48 |
|
5750
4b3eae08b84b
preserve method-packages when recompiling
Claus Gittinger <cg@exept.de>
parents:
5725
diff
changeset
|
49 |
ClassDescription::PackageRedefinition subclass:#ClassRedefinitionNotification |
4604
a08bfac91f07
migrated redefinitionSignals to new exception scheme
Claus Gittinger <cg@exept.de>
parents:
4358
diff
changeset
|
50 |
instanceVariableNames:'' |
a08bfac91f07
migrated redefinitionSignals to new exception scheme
Claus Gittinger <cg@exept.de>
parents:
4358
diff
changeset
|
51 |
classVariableNames:'' |
a08bfac91f07
migrated redefinitionSignals to new exception scheme
Claus Gittinger <cg@exept.de>
parents:
4358
diff
changeset
|
52 |
poolDictionaries:'' |
a08bfac91f07
migrated redefinitionSignals to new exception scheme
Claus Gittinger <cg@exept.de>
parents:
4358
diff
changeset
|
53 |
privateIn:ClassDescription |
a08bfac91f07
migrated redefinitionSignals to new exception scheme
Claus Gittinger <cg@exept.de>
parents:
4358
diff
changeset
|
54 |
! |
a08bfac91f07
migrated redefinitionSignals to new exception scheme
Claus Gittinger <cg@exept.de>
parents:
4358
diff
changeset
|
55 |
|
1740 | 56 |
!ClassDescription class methodsFor:'documentation'! |
1 | 57 |
|
88 | 58 |
copyright |
59 |
" |
|
60 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
155 | 61 |
All Rights Reserved |
88 | 62 |
|
63 |
This software is furnished under a license and may be used |
|
64 |
only in accordance with the terms of that license and with the |
|
65 |
inclusion of the above copyright notice. This software may not |
|
66 |
be provided or otherwise made available to, or used by, any |
|
67 |
other person. No title to or ownership of the software is |
|
68 |
hereby transferred. |
|
69 |
" |
|
70 |
! |
|
71 |
||
68 | 72 |
documentation |
73 |
" |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
74 |
ClassDescription conceptually adds some descriptive information to the basic |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
75 |
Behavior class. It is an abstract class used as a common superclass |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
76 |
for Metaclass and Class. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
77 |
Subclasses must define the #name, #category and #comment methods. |
1 | 78 |
|
1292 | 79 |
[Instance variables:] |
80 |
||
8551 | 81 |
instvars <String> the names of the instance variables |
82 |
| <Collection of words> |
|
905 | 83 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
84 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
85 |
[Class variables:] |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
86 |
|
8551 | 87 |
UpdatingChanges <Boolean> true if the changes-file shall be updated |
88 |
(except during startup and when filing in, this flag |
|
89 |
is usually true) |
|
90 |
Please do no longer use this - see the two queries |
|
91 |
below. |
|
92 |
||
93 |
UpdateChangeFileQuerySignal used as an upQuery from the change management. |
|
94 |
Whenever a changeRecord is to be written, |
|
95 |
this signal is raised and a handler (if present) |
|
96 |
is supposed to return true or false. |
|
97 |
If unhandled, the value of the global |
|
98 |
UpdatingChanges is returned for backward |
|
99 |
compatibility (which means that the old |
|
100 |
mechanism is used if no query-handler |
|
101 |
is present). |
|
102 |
||
103 |
UpdateChangeListQuerySignal used as an upQuery from the change management. |
|
104 |
Whenever a change is to be added to the changeSet, |
|
105 |
this signal is raised and a handler (if present) |
|
106 |
is supposed to return true or false. |
|
107 |
If unhandled, the value of the global |
|
108 |
UpdatingChanges is returned for backward |
|
109 |
compatibility (which means that the old |
|
110 |
mechanism is used if no query-handler |
|
111 |
is present). |
|
112 |
||
113 |
LockChangesFile <Boolean> if true, the change file is locked for updates. |
|
114 |
Required when multiple users operate on a common |
|
115 |
change file. |
|
116 |
This is an experimental new feature, being evaluated. |
|
117 |
||
118 |
FileOutErrorSignal raised when an error occurs during fileOut |
|
119 |
||
120 |
CatchMethodRedefinitions if true, classes protect themself |
|
121 |
MethodRedefinitionSignal (by raising MethodRedefinitionSignal) |
|
122 |
from redefining any existing methods, |
|
123 |
which are defined in another package. |
|
124 |
(i.e. a signal will be raised, if you |
|
125 |
fileIn something which redefines an |
|
126 |
existing method and the packages do not |
|
127 |
match). |
|
128 |
The default is (currently) true. |
|
129 |
||
130 |
TryLocalSourceFirst If true, local source files are tried |
|
131 |
first BEFORE the sourceCodeManager is |
|
132 |
consulted. If false, the sourceCodeManager |
|
133 |
is asked first. |
|
134 |
Should be turned on, if you run an image from |
|
135 |
local sources which have not yet been checked in. |
|
136 |
||
137 |
NameSpaceQuerySignal used as an upQuery to ask for a namespace into |
|
138 |
which new classes are to be installed. |
|
139 |
||
140 |
PackageQuerySignal used as an upQuery to ask for a packageSymbol with |
|
141 |
which new classes/methods are to be marked. |
|
142 |
||
143 |
CreateNameSpaceQuerySignal used as an upQuery to ask if unknown namespaces |
|
144 |
should be silently created (without asking the user) |
|
145 |
||
146 |
MethodHistory if nonNil, this must be an OrderedCollection, |
|
147 |
which is filled with method->previousversionMethod |
|
148 |
associations. Can be used for undo-last-method-change |
|
149 |
The number of remembered methods is controlled via the |
|
150 |
UserPreferences. |
|
151 |
Notice: this may fillup your memory over time, |
|
152 |
the preferences are set too high. |
|
153 |
||
154 |
MethodHistorySize the size of the methodHistory |
|
155 |
(nil: unlimited) |
|
4358 | 156 |
|
1292 | 157 |
[author:] |
8551 | 158 |
Claus Gittinger |
1669 | 159 |
|
160 |
[see also:] |
|
8551 | 161 |
Behavior Class Metaclass |
68 | 162 |
" |
163 |
! ! |
|
1 | 164 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
165 |
!ClassDescription class methodsFor:'initialization'! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
166 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
167 |
initialize |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
168 |
"the classvariable 'UpdatingChanges' controls if changes are put |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
169 |
into the changes-file; normally this variable is set to true, but |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
170 |
(for example) during fileIn or when changes are applied, it is set to false |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
171 |
to avoid putting too much junk into the changes-file." |
8551 | 172 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
173 |
UpdatingChanges := true. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
174 |
LockChangesFile := false. |
3603 | 175 |
CatchMethodRedefinitions := CatchClassRedefinitions := true. |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
176 |
TryLocalSourceFirst := false. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
177 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
178 |
FileOutErrorSignal isNil ifTrue:[ |
9427
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
179 |
FileOutErrorSignal := Error newSignalMayProceed:true. |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
180 |
FileOutErrorSignal nameClass:self message:#fileOutErrorSignal. |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
181 |
FileOutErrorSignal notifierString:'error during fileOut'. |
3965
cef66fdfff9e
allow suppress of dialog when filed-in classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3918
diff
changeset
|
182 |
|
4604
a08bfac91f07
migrated redefinitionSignals to new exception scheme
Claus Gittinger <cg@exept.de>
parents:
4358
diff
changeset
|
183 |
"/ MethodRedefinitionSignal := QuerySignal new. |
a08bfac91f07
migrated redefinitionSignals to new exception scheme
Claus Gittinger <cg@exept.de>
parents:
4358
diff
changeset
|
184 |
"/ MethodRedefinitionSignal nameClass:self message:#methodRedefinitionSignal. |
a08bfac91f07
migrated redefinitionSignals to new exception scheme
Claus Gittinger <cg@exept.de>
parents:
4358
diff
changeset
|
185 |
"/ MethodRedefinitionSignal notifierString:'attempt to redefine method from different package'. |
a08bfac91f07
migrated redefinitionSignals to new exception scheme
Claus Gittinger <cg@exept.de>
parents:
4358
diff
changeset
|
186 |
"/ MethodRedefinitionSignal defaultAnswer:#keep. |
a08bfac91f07
migrated redefinitionSignals to new exception scheme
Claus Gittinger <cg@exept.de>
parents:
4358
diff
changeset
|
187 |
|
a08bfac91f07
migrated redefinitionSignals to new exception scheme
Claus Gittinger <cg@exept.de>
parents:
4358
diff
changeset
|
188 |
"/ ClassRedefinitionSignal := QuerySignal new. |
a08bfac91f07
migrated redefinitionSignals to new exception scheme
Claus Gittinger <cg@exept.de>
parents:
4358
diff
changeset
|
189 |
"/ ClassRedefinitionSignal nameClass:self message:#classRedefinitionSignal. |
a08bfac91f07
migrated redefinitionSignals to new exception scheme
Claus Gittinger <cg@exept.de>
parents:
4358
diff
changeset
|
190 |
"/ ClassRedefinitionSignal notifierString:'attempt to redefine class from different package'. |
a08bfac91f07
migrated redefinitionSignals to new exception scheme
Claus Gittinger <cg@exept.de>
parents:
4358
diff
changeset
|
191 |
"/ ClassRedefinitionSignal defaultAnswer:#keep. |
3965
cef66fdfff9e
allow suppress of dialog when filed-in classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3918
diff
changeset
|
192 |
|
9427
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
193 |
UpdateHistoryLineQuerySignal := QuerySignal new. |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
194 |
UpdateHistoryLineQuerySignal nameClass:self message:#updateHistoryLineQuerySignal. |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
195 |
UpdateHistoryLineQuerySignal notifierString:'asking if history line update in method is wanted'. |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
196 |
UpdateHistoryLineQuerySignal handlerBlock:[:ex | ex proceedWith:false]. |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
197 |
|
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
198 |
UpdateChangeFileQuerySignal := QuerySignal new. |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
199 |
UpdateChangeFileQuerySignal nameClass:self message:#updateChangeFileQuerySignal. |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
200 |
UpdateChangeFileQuerySignal notifierString:'asking if changeFile update is wanted'. |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
201 |
UpdateChangeFileQuerySignal handlerBlock:[:ex | ex proceedWith:UpdatingChanges]. |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
202 |
|
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
203 |
UpdateChangeListQuerySignal := QuerySignal new. |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
204 |
UpdateChangeListQuerySignal nameClass:self message:#updateChangeListQuerySignal. |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
205 |
UpdateChangeListQuerySignal notifierString:'asking if changeList update is wanted'. |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
206 |
UpdateChangeListQuerySignal handlerBlock:[:ex | ex proceedWith:UpdatingChanges]. |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
207 |
|
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
208 |
NameSpaceQuerySignal isNil ifTrue:[ |
20406 | 209 |
"This could be used BEFORE initialize has been invoked - that's why we initialize |
9561
558e31b007d5
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
9527
diff
changeset
|
210 |
the class var there." |
558e31b007d5
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
9527
diff
changeset
|
211 |
NameSpaceQuerySignal := self nameSpaceQuerySignal |
9427
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
212 |
]. |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
213 |
UsedNameSpaceQuerySignal isNil ifTrue:[ |
21801 | 214 |
"This could be used BEFORE initialize has been invoked - that's why we initialize |
9561
558e31b007d5
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
9527
diff
changeset
|
215 |
the class var there." |
558e31b007d5
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
9527
diff
changeset
|
216 |
UsedNameSpaceQuerySignal := self usedNameSpaceQuerySignal. |
9427
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
217 |
]. |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
218 |
|
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
219 |
CreateNameSpaceQuerySignal := QuerySignal new. |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
220 |
CreateNameSpaceQuerySignal nameClass:self message:#createNameSpaceQuerySignal. |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
221 |
CreateNameSpaceQuerySignal notifierString:'asking for nameSpace creation'. |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
222 |
CreateNameSpaceQuerySignal defaultAnswer:false. |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
223 |
|
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
224 |
ClassConventionViolationConfirmationQuerySignal := QuerySignal new. |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
225 |
ClassConventionViolationConfirmationQuerySignal nameClass:self message:#classConventionViolationConfirmationQuerySignal. |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
226 |
ClassConventionViolationConfirmationQuerySignal notifierString:'asking for class convention'. |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
227 |
|
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
228 |
PackageQuerySignal := QuerySignal new. |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
229 |
PackageQuerySignal nameClass:self message:#packageQuerySignal. |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
230 |
PackageQuerySignal notifierString:'asking for package'. |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
231 |
PackageQuerySignal handlerBlock:[:ex | ex proceedWith:(Project isNil |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
232 |
ifTrue:[ |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
233 |
nil |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
234 |
] ifFalse:[ |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
235 |
Project currentPackageName |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
236 |
])]. |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
237 |
|
12110 | 238 |
ClassCategoryQuerySignal := QuerySignal new. |
239 |
ClassCategoryQuerySignal nameClass:self message:#classCategoryQuerySignal. |
|
240 |
ClassCategoryQuerySignal notifierString:'asking for category'. |
|
241 |
ClassCategoryQuerySignal handlerBlock:[:ex | ex proceedWith:'* as yet unspecified *']. |
|
242 |
||
9427
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
243 |
FileOutNameSpaceQuerySignal := QuerySignal new. |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
244 |
FileOutNameSpaceQuerySignal defaultAnswer:false. |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
245 |
|
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
246 |
ForceNoNameSpaceQuerySignal := QuerySignal new. |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
247 |
ForceNoNameSpaceQuerySignal defaultAnswer:false. |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
248 |
|
24399 | 249 |
ChangeFileAccessLock := RecursionLock name:'changeFile access'. |
9427
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
250 |
ChangeFileAccessLock name:'ChangeFileAccessLock'. |
3583 | 251 |
]. |
252 |
||
253 |
DefaultApplicationQuerySignal isNil ifTrue:[ |
|
9427
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
254 |
DefaultApplicationQuerySignal := QuerySignal new defaultAnswer:nil. |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
255 |
DefaultApplicationQuerySignal nameClass:self message:#defaultApplicationQuerySignal. |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
256 |
DefaultApplicationQuerySignal notifierString:'query for default application'. |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
257 |
|
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
258 |
ChangeDefaultApplicationNotificationSignal := QuerySignal new defaultAnswer:nil. |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
259 |
ChangeDefaultApplicationNotificationSignal nameClass:self message:#changeDefaultApplicationNotificationSignal. |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
260 |
ChangeDefaultApplicationNotificationSignal notifierString:'change default application'. |
3583 | 261 |
]. |
262 |
||
263 |
" |
|
264 |
ClassDescription initialize |
|
265 |
" |
|
266 |
||
9427
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
267 |
"Created: / 02-04-1997 / 17:27:40 / stefan" |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
268 |
"Modified: / 17-03-1999 / 16:52:41 / stefan" |
9561
558e31b007d5
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
9527
diff
changeset
|
269 |
"Modified: / 17-08-2006 / 14:04:17 / cg" |
21801 | 270 |
"Modified (format): / 12-06-2017 / 20:58:10 / cg" |
24399 | 271 |
"Modified: / 28-06-2019 / 13:11:50 / Claus Gittinger" |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
272 |
! ! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
273 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
274 |
!ClassDescription class methodsFor:'Signal constants'! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
275 |
|
3583 | 276 |
changeDefaultApplicationNotificationSignal |
277 |
"return the signal used as an up-Info to change the current application to which |
|
278 |
new classes/methods will be added. |
|
279 |
Will is only used when filing in V'Age code" |
|
280 |
||
281 |
^ ChangeDefaultApplicationNotificationSignal |
|
282 |
||
283 |
" |
|
284 |
Transcript showCR:Class changeDefaultApplicationNotificationSignal raise |
|
285 |
" |
|
286 |
||
287 |
"Modified: / 5.11.1996 / 20:08:38 / cg" |
|
288 |
"Created: / 15.6.1998 / 18:29:57 / cg" |
|
289 |
! |
|
290 |
||
12110 | 291 |
classCategoryQuerySignal |
292 |
"return the signal used as an upQuery for the current class category name. |
|
293 |
Will be used when defining a class without a proper classCategory information |
|
294 |
(JS or Ruby classes). The browser will answer with the currently selected category then." |
|
295 |
||
296 |
^ ClassCategoryQuerySignal |
|
297 |
||
298 |
" |
|
299 |
Transcript showCR:Class classCategoryQuerySignal raise |
|
300 |
" |
|
301 |
! |
|
302 |
||
3965
cef66fdfff9e
allow suppress of dialog when filed-in classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3918
diff
changeset
|
303 |
classConventionViolationConfirmationQuerySignal |
cef66fdfff9e
allow suppress of dialog when filed-in classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3918
diff
changeset
|
304 |
"return the query signal raised when a class is about to be installed |
cef66fdfff9e
allow suppress of dialog when filed-in classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3918
diff
changeset
|
305 |
(or changed) which violates conventions (such as upper case instVars). |
cef66fdfff9e
allow suppress of dialog when filed-in classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3918
diff
changeset
|
306 |
This is raised in subclass creation and can be handled to suppress |
cef66fdfff9e
allow suppress of dialog when filed-in classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3918
diff
changeset
|
307 |
dialog boxes popping up during fileIn" |
cef66fdfff9e
allow suppress of dialog when filed-in classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3918
diff
changeset
|
308 |
|
cef66fdfff9e
allow suppress of dialog when filed-in classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3918
diff
changeset
|
309 |
^ ClassConventionViolationConfirmationQuerySignal |
cef66fdfff9e
allow suppress of dialog when filed-in classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3918
diff
changeset
|
310 |
|
cef66fdfff9e
allow suppress of dialog when filed-in classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3918
diff
changeset
|
311 |
"Created: / 3.2.1999 / 11:22:07 / cg" |
cef66fdfff9e
allow suppress of dialog when filed-in classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3918
diff
changeset
|
312 |
! |
cef66fdfff9e
allow suppress of dialog when filed-in classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3918
diff
changeset
|
313 |
|
8837
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
314 |
classRedefinitionNotification |
3596
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
315 |
"return the signal raised when a class is about to be redefined |
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
316 |
differently from an existing class and the packages are not |
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
317 |
equal. This helps when filing in alien code, to prevent existing |
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
318 |
classes from being redefined by incompatible classes |
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
319 |
(classVars, classInstVars or inheritance)." |
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
320 |
|
4604
a08bfac91f07
migrated redefinitionSignals to new exception scheme
Claus Gittinger <cg@exept.de>
parents:
4358
diff
changeset
|
321 |
^ ClassDescription::ClassRedefinitionNotification |
3596
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
322 |
|
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
323 |
"Created: / 17.6.1998 / 10:13:44 / cg" |
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
324 |
! |
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
325 |
|
8837
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
326 |
classRedefinitionSignal |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
327 |
"use #classRedefinitionNotification" |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
328 |
<resource: #obsolete> |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
329 |
|
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
330 |
^ ClassDescription::ClassRedefinitionNotification |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
331 |
|
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
332 |
"Created: / 17.6.1998 / 10:13:44 / cg" |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
333 |
! |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
334 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
335 |
createNameSpaceQuerySignal |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
336 |
"return the signal used as an upQuery if a new nameSpace should be |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
337 |
silently created without user confirmation. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
338 |
Only used when installing autoloaded classes" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
339 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
340 |
^ CreateNameSpaceQuerySignal |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
341 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
342 |
"Created: 2.4.1997 / 17:27:54 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
343 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
344 |
|
3583 | 345 |
defaultApplicationQuerySignal |
346 |
"return the signal used as an upQuery for the current application to which |
|
347 |
new classes/methods are to be added. |
|
348 |
Will is only used when filing in V'Age code" |
|
349 |
||
350 |
^ DefaultApplicationQuerySignal |
|
351 |
||
352 |
" |
|
353 |
Transcript showCR:Class defaultApplicationQuerySignal raise |
|
354 |
" |
|
355 |
||
356 |
"Modified: / 5.11.1996 / 20:08:38 / cg" |
|
357 |
"Created: / 15.6.1998 / 18:28:54 / cg" |
|
358 |
! |
|
359 |
||
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
360 |
fileOutErrorSignal |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
361 |
"return the signal raised when an error occurs while fileing out. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
362 |
This is signalled to allow browsers some user feed back in case |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
363 |
a fileout fails (for example due to disk-full errors)" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
364 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
365 |
^ FileOutErrorSignal |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
366 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
367 |
"Created: 2.4.1997 / 17:28:03 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
368 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
369 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
370 |
fileOutNameSpaceQuerySignal |
15564 | 371 |
"return the signal used as an upQuery whether the current |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
372 |
namespace should be prepended on fileOut." |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
373 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
374 |
^ FileOutNameSpaceQuerySignal |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
375 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
376 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
377 |
Transcript showCR:Class fileOutNameSpaceQuerySignal raise |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
378 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
379 |
|
15564 | 380 |
"Modified: / 05-11-1996 / 20:08:38 / cg" |
381 |
"Created: / 02-04-1997 / 17:28:41 / stefan" |
|
382 |
"Modified (comment): / 27-07-2013 / 15:35:32 / cg" |
|
3406
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
383 |
! |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
384 |
|
8229 | 385 |
forceNoNameSpaceQuerySignal |
386 |
^ ForceNoNameSpaceQuerySignal |
|
387 |
! |
|
388 |
||
8837
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
389 |
methodRedefinitionNotification |
3406
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
390 |
"return the signal raised when a method is about to be installed |
22366 | 391 |
which redefines an existing method and the method's packages are not |
3406
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
392 |
equal. This helps when filing in alien code, to prevent existing |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
393 |
methods to be overwritten or redefined by incompatible methods" |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
394 |
|
4604
a08bfac91f07
migrated redefinitionSignals to new exception scheme
Claus Gittinger <cg@exept.de>
parents:
4358
diff
changeset
|
395 |
^ ClassDescription::MethodRedefinitionNotification |
22366 | 396 |
|
397 |
"Modified (comment): / 21-11-2017 / 12:59:38 / cg" |
|
3406
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
398 |
! |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
399 |
|
8837
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
400 |
methodRedefinitionSignal |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
401 |
"use #methodRedefinitionNotification" |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
402 |
<resource: #obsolete> |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
403 |
|
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
404 |
^ ClassDescription::MethodRedefinitionNotification |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
405 |
! |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
406 |
|
3406
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
407 |
nameSpaceQuerySignal |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
408 |
"return the signal used as an upQuery for the current nameSpace. |
9561
558e31b007d5
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
9527
diff
changeset
|
409 |
Will be used when filing in code. |
20406 | 410 |
This could be used BEFORE initialize has been invoked - that's why we do not |
9561
558e31b007d5
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
9527
diff
changeset
|
411 |
simply return the class var here." |
3406
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
412 |
|
5832
c41bce6f3eb1
nameSpaceQuerySignal may be asked for BEFORE class is
Claus Gittinger <cg@exept.de>
parents:
5797
diff
changeset
|
413 |
NameSpaceQuerySignal isNil ifTrue:[ |
9561
558e31b007d5
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
9527
diff
changeset
|
414 |
NameSpaceQuerySignal := QuerySignal new. |
558e31b007d5
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
9527
diff
changeset
|
415 |
NameSpaceQuerySignal nameClass:self message:#nameSpaceQuerySignal. |
558e31b007d5
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
9527
diff
changeset
|
416 |
NameSpaceQuerySignal notifierString:'asking for nameSpace'. |
558e31b007d5
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
9527
diff
changeset
|
417 |
NameSpaceQuerySignal handlerBlock:[:ex | ex proceedWith:Project defaultNameSpace]. |
5832
c41bce6f3eb1
nameSpaceQuerySignal may be asked for BEFORE class is
Claus Gittinger <cg@exept.de>
parents:
5797
diff
changeset
|
418 |
]. |
3406
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
419 |
^ NameSpaceQuerySignal |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
420 |
|
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
421 |
" |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
422 |
Transcript showCR:Class nameSpaceQuerySignal raise |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
423 |
" |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
424 |
|
9561
558e31b007d5
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
9527
diff
changeset
|
425 |
"Modified: / 17-08-2006 / 14:03:39 / cg" |
3406
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
426 |
! |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
427 |
|
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
428 |
packageQuerySignal |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
429 |
"return the signal used as an upQuery for the current packages name. |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
430 |
Will be used when filing in code" |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
431 |
|
16167 | 432 |
PackageQuerySignal isNil ifTrue:[ ClassDescription initialize ]. |
3406
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
433 |
^ PackageQuerySignal |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
434 |
|
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
435 |
" |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
436 |
Transcript showCR:Class packageQuerySignal raise |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
437 |
" |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
438 |
|
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
439 |
"Created: 5.11.1996 / 20:07:22 / cg" |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
440 |
"Modified: 5.11.1996 / 20:08:35 / cg" |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
441 |
! |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
442 |
|
8837
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
443 |
packageRedefinitionNotification |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
444 |
"return the signal raised when a class or method is about to be installed |
22366 | 445 |
which redefines an existing method and the method's packages are not |
8837
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
446 |
equal. This helps when filing in alien code, to prevent existing |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
447 |
methods to be overwritten or redefined by incompatible methods" |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
448 |
|
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
449 |
^ ClassDescription::PackageRedefinition |
22366 | 450 |
|
451 |
"Modified (comment): / 21-11-2017 / 12:59:42 / cg" |
|
8837
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
452 |
! |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
453 |
|
3406
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
454 |
updateChangeFileQuerySignal |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
455 |
"return the signal used as an upQuery if the changeFile should be updated. |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
456 |
If unhandled, the value of UpdatingChanges is returned by the signals |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
457 |
static handler." |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
458 |
|
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
459 |
^ UpdateChangeFileQuerySignal |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
460 |
|
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
461 |
" |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
462 |
Transcript showCR:Class updateChangeFileQuerySignal raise |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
463 |
" |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
464 |
|
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
465 |
"Modified: 5.11.1996 / 20:08:44 / cg" |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
466 |
! |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
467 |
|
6097 | 468 |
updateChangeListQuerySignal |
469 |
"return the signal used as an upQuery if the changeList should be updated. |
|
470 |
If unhandled, the value of UpdatingChanges is returned by the signals |
|
471 |
static handler." |
|
472 |
||
473 |
^ UpdateChangeListQuerySignal |
|
474 |
||
475 |
" |
|
476 |
Transcript showCR:Class updateChangeListQuerySignal raise |
|
477 |
" |
|
478 |
! |
|
479 |
||
9427
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
480 |
updateHistoryLineQuerySignal |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
481 |
"return the signal used as an upQuery if the historyline of a method should be updated. |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
482 |
If unhandled, the history managers setting is returned by the signals |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
483 |
static handler." |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
484 |
|
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
485 |
^ UpdateHistoryLineQuerySignal |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
486 |
|
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
487 |
" |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
488 |
Class updateHistoryLineQuerySignal raise |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
489 |
" |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
490 |
|
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
491 |
"Created: / 05-07-2006 / 17:30:52 / cg" |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
492 |
! |
2b8b41a72283
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
493 |
|
3406
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
494 |
usedNameSpaceQuerySignal |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
495 |
"return the signal used as an upQuery for the used nameSpace. |
9561
558e31b007d5
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
9527
diff
changeset
|
496 |
Will be used when filing in code. |
20406 | 497 |
This could be used BEFORE initialize has been invoked - that's why we do not |
9561
558e31b007d5
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
9527
diff
changeset
|
498 |
simply return the class var here." |
3406
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
499 |
|
5833 | 500 |
UsedNameSpaceQuerySignal isNil ifTrue:[ |
9561
558e31b007d5
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
9527
diff
changeset
|
501 |
UsedNameSpaceQuerySignal := QuerySignal new. |
558e31b007d5
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
9527
diff
changeset
|
502 |
UsedNameSpaceQuerySignal nameClass:self message:#usedNameSpaceQuerySignal. |
558e31b007d5
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
9527
diff
changeset
|
503 |
UsedNameSpaceQuerySignal notifierString:'asking for used nameSpaced'. |
5833 | 504 |
]. |
3406
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
505 |
^ UsedNameSpaceQuerySignal |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
506 |
|
9561
558e31b007d5
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
9527
diff
changeset
|
507 |
"Created: / 19-12-1996 / 23:57:27 / cg" |
558e31b007d5
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
9527
diff
changeset
|
508 |
"Modified: / 17-08-2006 / 14:03:33 / cg" |
3406
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
509 |
! ! |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
510 |
|
7309 | 511 |
!ClassDescription class methodsFor:'accessing-flags'! |
3406
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
512 |
|
3596
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
513 |
catchClassRedefinitions |
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
514 |
"return the class-redefinition catching flag." |
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
515 |
|
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
516 |
^ CatchClassRedefinitions |
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
517 |
|
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
518 |
"Created: / 17.6.1998 / 10:30:01 / cg" |
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
519 |
! |
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
520 |
|
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
521 |
catchClassRedefinitions:aBoolean |
8551 | 522 |
"turn on/off class redefinition catching. |
3596
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
523 |
If on, redefining classes from another package will show a |
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
524 |
warning dialog. Useful, when filing in alien code to avoid defefinition |
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
525 |
of system methods. |
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
526 |
Return the prior value of the flag." |
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
527 |
|
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
528 |
|prev| |
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
529 |
|
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
530 |
prev := CatchClassRedefinitions. |
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
531 |
CatchClassRedefinitions := aBoolean. |
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
532 |
^ prev |
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
533 |
|
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
534 |
"Created: / 17.6.1998 / 10:31:19 / cg" |
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
535 |
! |
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
536 |
|
3406
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
537 |
catchMethodRedefinitions |
3596
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
538 |
"return the method-redefinition catching flag." |
3406
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
539 |
|
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
540 |
^ CatchMethodRedefinitions |
3596
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
541 |
|
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
542 |
"Modified: / 17.6.1998 / 10:30:10 / cg" |
3406
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
543 |
! |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
544 |
|
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
545 |
catchMethodRedefinitions:aBoolean |
8551 | 546 |
"turn on/off method redefinition catching. |
3596
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
547 |
If on, redefining methods from another package will show a |
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
548 |
warning dialog. Useful, when filing in alien code to avoid defefinition |
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
549 |
of system methods. |
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
550 |
Return the prior value of the flag." |
3406
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
551 |
|
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
552 |
|prev| |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
553 |
|
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
554 |
prev := CatchMethodRedefinitions. |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
555 |
CatchMethodRedefinitions := aBoolean. |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
556 |
^ prev |
3596
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
557 |
|
d19a2f605da3
also allow catching of class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3583
diff
changeset
|
558 |
"Modified: / 17.6.1998 / 10:31:02 / cg" |
3406
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
559 |
! |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
560 |
|
4345
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
561 |
keepMethodHistory:aBoolean |
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
562 |
"turn on/off oldMethod remembering. If on, a methods previous version |
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
563 |
is kept locally, for later undo (or compare)." |
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
564 |
|
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
565 |
aBoolean ifTrue:[ |
8551 | 566 |
MethodHistory isNil ifTrue:[ |
567 |
MethodHistory := OrderedCollection new. |
|
568 |
] |
|
4345
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
569 |
] ifFalse:[ |
8551 | 570 |
MethodHistory := nil |
4345
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
571 |
]. |
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
572 |
|
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
573 |
" |
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
574 |
Class keepMethodHistory:true |
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
575 |
Class keepMethodHistory:false |
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
576 |
" |
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
577 |
|
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
578 |
"Modified: 7.11.1996 / 18:36:00 / cg" |
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
579 |
"Created: 7.11.1996 / 19:05:57 / cg" |
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
580 |
! |
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
581 |
|
3406
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
582 |
lockChangesFile |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
583 |
"return true, if the change file is locked during update" |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
584 |
|
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
585 |
^ LockChangesFile |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
586 |
! |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
587 |
|
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
588 |
lockChangesFile:aBoolean |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
589 |
"turn on/off change-file-locking. Return the previous value of the flag." |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
590 |
|
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
591 |
|prev| |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
592 |
|
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
593 |
prev := LockChangesFile. |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
594 |
LockChangesFile := aBoolean. |
de3426236e28
moved signal accessors from Class.
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
595 |
^ prev |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
596 |
! ! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
597 |
|
7309 | 598 |
!ClassDescription class methodsFor:'accessing-history'! |
4345
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
599 |
|
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
600 |
flushMethodHistory |
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
601 |
"flush any method->previousVersion associations, |
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
602 |
all method history is lost." |
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
603 |
|
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
604 |
MethodHistory notNil ifTrue:[ |
8551 | 605 |
MethodHistory := OrderedCollection new |
4345
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
606 |
]. |
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
607 |
|
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
608 |
"Created: 7.11.1996 / 19:07:25 / cg" |
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
609 |
! |
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
610 |
|
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
611 |
methodHistory |
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
612 |
"return a dictionary containing method->previousVersion associations, |
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
613 |
nil if method remembering has been turned off" |
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
614 |
|
8551 | 615 |
^ MethodHistory |
4345
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
616 |
|
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
617 |
" |
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
618 |
Class methodHistory |
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
619 |
" |
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
620 |
|
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
621 |
"Modified: 7.11.1996 / 18:36:00 / cg" |
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
622 |
"Created: 7.11.1996 / 19:06:28 / cg" |
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
623 |
! ! |
030d3a420dc8
renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
624 |
|
6099 | 625 |
!ClassDescription class methodsFor:'enumeration'! |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
626 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
627 |
allClassesInCategory:aCategory do:aBlock |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
628 |
"evaluate aBlock for all classes in aCategory; |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
629 |
no specific order is defined." |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
630 |
|
8356 | 631 |
<resource: #obsolete> |
6216
fbc90be5ce40
obsolete methods marked as such
Claus Gittinger <cg@exept.de>
parents:
6114
diff
changeset
|
632 |
self obsoleteMethodWarning:'moved to Smalltalk'. |
fbc90be5ce40
obsolete methods marked as such
Claus Gittinger <cg@exept.de>
parents:
6114
diff
changeset
|
633 |
Smalltalk allClassesInCategory:aCategory do:aBlock |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
634 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
635 |
" |
8551 | 636 |
Class allClassesInCategory:'Kernel-Classes' |
637 |
do:[:class |Transcript showCR:class name] |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
638 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
639 |
|
6216
fbc90be5ce40
obsolete methods marked as such
Claus Gittinger <cg@exept.de>
parents:
6114
diff
changeset
|
640 |
"Created: / 1.4.1997 / 23:45:09 / stefan" |
fbc90be5ce40
obsolete methods marked as such
Claus Gittinger <cg@exept.de>
parents:
6114
diff
changeset
|
641 |
"Modified: / 17.11.2001 / 12:28:50 / cg" |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
642 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
643 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
644 |
allClassesInCategory:aCategory inOrderDo:aBlock |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
645 |
"evaluate aBlock for all classes in aCategory; |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
646 |
superclasses come first - then subclasses." |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
647 |
|
8356 | 648 |
<resource: #obsolete> |
6216
fbc90be5ce40
obsolete methods marked as such
Claus Gittinger <cg@exept.de>
parents:
6114
diff
changeset
|
649 |
self obsoleteMethodWarning:'moved to Smalltalk'. |
6114 | 650 |
Smalltalk allClassesInCategory:aCategory inOrderDo:aBlock |
6216
fbc90be5ce40
obsolete methods marked as such
Claus Gittinger <cg@exept.de>
parents:
6114
diff
changeset
|
651 |
|
fbc90be5ce40
obsolete methods marked as such
Claus Gittinger <cg@exept.de>
parents:
6114
diff
changeset
|
652 |
"Created: / 1.4.1997 / 23:45:15 / stefan" |
fbc90be5ce40
obsolete methods marked as such
Claus Gittinger <cg@exept.de>
parents:
6114
diff
changeset
|
653 |
"Modified: / 17.11.2001 / 12:28:40 / cg" |
356 | 654 |
! ! |
655 |
||
1740 | 656 |
!ClassDescription class methodsFor:'queries'! |
1179
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
657 |
|
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
658 |
isBuiltInClass |
1266 | 659 |
"return true if this class is known by the run-time-system. |
660 |
Here, true is returned for myself, false for subclasses." |
|
661 |
||
1179
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
662 |
^ self == ClassDescription class or:[self == ClassDescription] |
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
663 |
|
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
664 |
"Created: 15.4.1996 / 17:16:59 / cg" |
1266 | 665 |
"Modified: 23.4.1996 / 15:56:54 / cg" |
1179
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
666 |
! ! |
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
667 |
|
7261 | 668 |
!ClassDescription methodsFor:'Compatibility-Dolphin'! |
5515 | 669 |
|
670 |
methodsFor |
|
671 |
"this method allows fileIn of Dolphin methods - |
|
672 |
return a ClassCategoryReader to read in and compile methods for me. |
|
673 |
Since Dolphin uses a different way to assign method categories, |
|
674 |
the loaded methods are temporarily categorized as 'Dolphin methods' |
|
675 |
and later reassigned, when a categoriesFor: message arrives." |
|
676 |
||
677 |
^ ClassCategoryReader class:self category:'Dolphin methods' |
|
678 |
||
6817 | 679 |
! |
680 |
||
681 |
sourceManager |
|
682 |
"Answer the receiver's source manager." |
|
683 |
||
684 |
^ Dolphin::SourceManager default |
|
5515 | 685 |
! ! |
686 |
||
24399 | 687 |
|
7261 | 688 |
!ClassDescription methodsFor:'Compatibility-ST80'! |
3047 | 689 |
|
5631
d0965449b419
added #addInstVarName & #removeInstVarName
Claus Gittinger <cg@exept.de>
parents:
5581
diff
changeset
|
690 |
addInstVarName:anotherInstVar |
15946 | 691 |
^ self addInstVarName:anotherInstVar afterIndex: nil |
692 |
||
693 |
"Modified: / 25-02-2009 / 14:51:01 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
694 |
"Modified: / 18-01-2011 / 17:57:23 / cg" |
|
695 |
"Modified: / 31-01-2014 / 02:00:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
696 |
! |
|
697 |
||
698 |
addInstVarName:anotherInstVar afterIndex: indexOrNil |
|
699 |
|newClass newNames| |
|
700 |
||
701 |
indexOrNil notNil ifTrue:[ |
|
702 |
| oldNames | |
|
703 |
||
704 |
oldNames := self instVarNames asOrderedCollection. |
|
705 |
oldNames := oldNames add: anotherInstVar afterIndex: (indexOrNil min: oldNames size). |
|
706 |
newNames := oldNames asStringWith:' '. |
|
707 |
] ifFalse:[ |
|
708 |
newNames := self instanceVariableString , ' ' , anotherInstVar. |
|
709 |
]. |
|
5631
d0965449b419
added #addInstVarName & #removeInstVarName
Claus Gittinger <cg@exept.de>
parents:
5581
diff
changeset
|
710 |
|
5688
cb6f36cb44f0
addInstVarName for meta classes
Claus Gittinger <cg@exept.de>
parents:
5664
diff
changeset
|
711 |
self isMeta ifTrue:[ |
11988 | 712 |
^ self instanceVariableNames:newNames. |
5688
cb6f36cb44f0
addInstVarName for meta classes
Claus Gittinger <cg@exept.de>
parents:
5664
diff
changeset
|
713 |
]. |
11988 | 714 |
"Jan Vrany: I replaced original Claus code. |
715 |
See comment at the end of this method" |
|
716 |
newClass := self theMetaclass |
|
717 |
name:self nameWithoutPrefix |
|
718 |
inEnvironment:self nameSpace |
|
719 |
subclassOf:self superclass |
|
720 |
instanceVariableNames: newNames |
|
721 |
variable:self isVariable |
|
722 |
words:self isWords |
|
723 |
pointers:self isPointers |
|
724 |
classVariableNames:self classVariableString |
|
13217 | 725 |
poolDictionaries: (self poolDictionaries) |
11988 | 726 |
category:self category |
727 |
comment:self comment |
|
728 |
changed:true. |
|
729 |
newClass isNil |
|
730 |
ifTrue:[self error:'oops - cannot compile newClass'] |
|
731 |
ifFalse:[newClass recompile]. |
|
732 |
||
733 |
^newClass |
|
734 |
||
735 |
||
736 |
||
737 |
" |
|
738 |
Wrong implementation - does not respect |
|
739 |
my metaclass, my superclasses's metaclass is |
|
740 |
used. So, adding instvar to javascript/ruby |
|
741 |
class makes it a normal smalltalk class. |
|
742 |
" |
|
743 |
"sel := self definitionSelector. |
|
5631
d0965449b419
added #addInstVarName & #removeInstVarName
Claus Gittinger <cg@exept.de>
parents:
5581
diff
changeset
|
744 |
Class nameSpaceQuerySignal answer:(self nameSpace) |
d0965449b419
added #addInstVarName & #removeInstVarName
Claus Gittinger <cg@exept.de>
parents:
5581
diff
changeset
|
745 |
do:[ |
11988 | 746 |
args := Array |
747 |
with:(self nameWithoutPrefix asSymbol) |
|
748 |
with:newNames |
|
749 |
with:(self classVariableString) |
|
750 |
with:'' |
|
751 |
with:(self category). |
|
752 |
||
753 |
sel numArgs == 6 ifTrue:[ |
|
754 |
args := args copyWith:(self owningClass). |
|
755 |
]. |
|
756 |
||
757 |
newClass := self superclass |
|
758 |
perform:sel withArguments:args. |
|
759 |
newClass isNil ifTrue:[ |
|
760 |
self error:'oops - cannot compile newClass'. |
|
761 |
] ifFalse:[ |
|
762 |
newClass recompile. |
|
763 |
] |
|
5631
d0965449b419
added #addInstVarName & #removeInstVarName
Claus Gittinger <cg@exept.de>
parents:
5581
diff
changeset
|
764 |
]. |
d0965449b419
added #addInstVarName & #removeInstVarName
Claus Gittinger <cg@exept.de>
parents:
5581
diff
changeset
|
765 |
|
d0965449b419
added #addInstVarName & #removeInstVarName
Claus Gittinger <cg@exept.de>
parents:
5581
diff
changeset
|
766 |
^ newClass |
11988 | 767 |
" |
768 |
||
15946 | 769 |
"Created: / 31-01-2014 / 01:51:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
770 |
"Modified (format): / 05-02-2014 / 18:12:25 / cg" |
|
5631
d0965449b419
added #addInstVarName & #removeInstVarName
Claus Gittinger <cg@exept.de>
parents:
5581
diff
changeset
|
771 |
! |
d0965449b419
added #addInstVarName & #removeInstVarName
Claus Gittinger <cg@exept.de>
parents:
5581
diff
changeset
|
772 |
|
3047 | 773 |
organization |
8551 | 774 |
"for ST80 compatibility; |
3047 | 775 |
read the documentation in ClassOrganizer for more info." |
776 |
||
777 |
^ ClassOrganizer for:self |
|
3344
088c84bfad31
added #reorganizeFromString: for ST80-compat
Claus Gittinger <cg@exept.de>
parents:
3329
diff
changeset
|
778 |
! |
088c84bfad31
added #reorganizeFromString: for ST80-compat
Claus Gittinger <cg@exept.de>
parents:
3329
diff
changeset
|
779 |
|
6114 | 780 |
preSave: aParcel |
8551 | 781 |
"Allow additional process of a Parcel before writing. This method works |
782 |
with the matching method postLoad:, to handle additional processing |
|
783 |
after loading a Parcel. The typical operation to do here is to save |
|
784 |
named objects to aParcel (and retrieve them in postLoad:)." |
|
6114 | 785 |
! |
786 |
||
5631
d0965449b419
added #addInstVarName & #removeInstVarName
Claus Gittinger <cg@exept.de>
parents:
5581
diff
changeset
|
787 |
removeInstVarName:anInstVar |
15512 | 788 |
|newClass newNames| |
5631
d0965449b419
added #addInstVarName & #removeInstVarName
Claus Gittinger <cg@exept.de>
parents:
5581
diff
changeset
|
789 |
|
5711
d49686d3a048
addInstVarName/removeInstVarName fixed for private classes
Claus Gittinger <cg@exept.de>
parents:
5689
diff
changeset
|
790 |
newNames := self instVarNames asOrderedCollection. |
5631
d0965449b419
added #addInstVarName & #removeInstVarName
Claus Gittinger <cg@exept.de>
parents:
5581
diff
changeset
|
791 |
newNames remove:anInstVar ifAbsent:[^ self]. |
5689
320f0733e0f0
removeInstVarName for meta classes
Claus Gittinger <cg@exept.de>
parents:
5688
diff
changeset
|
792 |
newNames := newNames asStringWith:Character space. |
320f0733e0f0
removeInstVarName for meta classes
Claus Gittinger <cg@exept.de>
parents:
5688
diff
changeset
|
793 |
|
320f0733e0f0
removeInstVarName for meta classes
Claus Gittinger <cg@exept.de>
parents:
5688
diff
changeset
|
794 |
self isMeta ifTrue:[ |
15512 | 795 |
^ self instanceVariableNames:newNames. |
5689
320f0733e0f0
removeInstVarName for meta classes
Claus Gittinger <cg@exept.de>
parents:
5688
diff
changeset
|
796 |
]. |
5631
d0965449b419
added #addInstVarName & #removeInstVarName
Claus Gittinger <cg@exept.de>
parents:
5581
diff
changeset
|
797 |
|
d0965449b419
added #addInstVarName & #removeInstVarName
Claus Gittinger <cg@exept.de>
parents:
5581
diff
changeset
|
798 |
Class nameSpaceQuerySignal answer:(self nameSpace) |
d0965449b419
added #addInstVarName & #removeInstVarName
Claus Gittinger <cg@exept.de>
parents:
5581
diff
changeset
|
799 |
do:[ |
15512 | 800 |
|args sel| |
801 |
||
802 |
args := Array |
|
803 |
with:(self nameWithoutPrefix asSymbol) |
|
804 |
with:newNames |
|
805 |
with:(self classVariableString) |
|
806 |
with:(self isClass ifTrue:[self poolDictionaries] ifFalse:['']) |
|
807 |
with:(self category). |
|
808 |
||
809 |
sel := self definitionSelector. |
|
24746 | 810 |
sel argumentCount == 6 ifTrue:[ |
15512 | 811 |
args := args copyWith:(self owningClass). |
812 |
]. |
|
813 |
||
814 |
newClass := self superclass perform:sel withArguments:args. |
|
815 |
newClass recompile. |
|
5631
d0965449b419
added #addInstVarName & #removeInstVarName
Claus Gittinger <cg@exept.de>
parents:
5581
diff
changeset
|
816 |
]. |
d0965449b419
added #addInstVarName & #removeInstVarName
Claus Gittinger <cg@exept.de>
parents:
5581
diff
changeset
|
817 |
|
d0965449b419
added #addInstVarName & #removeInstVarName
Claus Gittinger <cg@exept.de>
parents:
5581
diff
changeset
|
818 |
^ newClass |
d0965449b419
added #addInstVarName & #removeInstVarName
Claus Gittinger <cg@exept.de>
parents:
5581
diff
changeset
|
819 |
! |
d0965449b419
added #addInstVarName & #removeInstVarName
Claus Gittinger <cg@exept.de>
parents:
5581
diff
changeset
|
820 |
|
5636 | 821 |
reorganize |
8551 | 822 |
"for ST80 compatibility; |
5636 | 823 |
nothing done here." |
824 |
! |
|
825 |
||
3344
088c84bfad31
added #reorganizeFromString: for ST80-compat
Claus Gittinger <cg@exept.de>
parents:
3329
diff
changeset
|
826 |
reorganizeFromString:orgString |
088c84bfad31
added #reorganizeFromString: for ST80-compat
Claus Gittinger <cg@exept.de>
parents:
3329
diff
changeset
|
827 |
"for ST80 compatibility but without functionality" |
088c84bfad31
added #reorganizeFromString: for ST80-compat
Claus Gittinger <cg@exept.de>
parents:
3329
diff
changeset
|
828 |
|
088c84bfad31
added #reorganizeFromString: for ST80-compat
Claus Gittinger <cg@exept.de>
parents:
3329
diff
changeset
|
829 |
"Created: / 28.3.1998 / 21:21:52 / cg" |
3047 | 830 |
! ! |
831 |
||
22004 | 832 |
!ClassDescription methodsFor:'Compatibility-Squeak'! |
833 |
||
834 |
protocols |
|
835 |
^ self categories |
|
836 |
||
837 |
"Created: / 13-07-2017 / 13:16:33 / cg" |
|
24918 | 838 |
! |
839 |
||
840 |
subclass:nameSymbol |
|
841 |
instanceVariableNames:instVarNameString |
|
842 |
classVariableNames:classVarNameString |
|
843 |
package:packageName |
|
844 |
||
845 |
"create a new class as a subclass of an existing class (the receiver). |
|
846 |
The subclass will have indexed variables if the receiving-class has. |
|
847 |
Squeak uses the category as package" |
|
848 |
||
849 |
^ self |
|
850 |
subclass:nameSymbol |
|
851 |
instanceVariableNames:instVarNameString |
|
852 |
classVariableNames:classVarNameString |
|
853 |
poolDictionaries:'' |
|
854 |
category:packageName |
|
22004 | 855 |
! ! |
21342 | 856 |
|
7261 | 857 |
!ClassDescription methodsFor:'Compatibility-V''Age'! |
3583 | 858 |
|
859 |
categoriesFor:aSelector are:listOfCategories |
|
860 |
"to allow fileIn of V'Age code. |
|
861 |
Set the category of the method which is installed under aSelector. |
|
862 |
Since ST/X only supports a single category, take the first one |
|
863 |
found in the listOfCategories." |
|
864 |
||
865 |
|mthd| |
|
866 |
||
867 |
(mthd := self compiledMethodAt:aSelector) notNil ifTrue:[ |
|
8551 | 868 |
mthd category:listOfCategories first. |
3583 | 869 |
]. |
870 |
||
871 |
"Created: / 15.6.1998 / 17:11:02 / cg" |
|
872 |
"Modified: / 15.6.1998 / 20:32:28 / cg" |
|
873 |
! |
|
874 |
||
875 |
commentFor:aSelector is:aString |
|
876 |
"to allow fileIn of V'Age code. |
|
877 |
Set the comment of the method which is installed under aSelector. |
|
878 |
For now, this is ignored" |
|
879 |
||
880 |
|mthd| |
|
881 |
||
882 |
(mthd := self compiledMethodAt:aSelector) notNil ifTrue:[ |
|
3918
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
883 |
"/ mthd comment:aString |
3583 | 884 |
]. |
885 |
||
886 |
"Created: / 15.6.1998 / 17:11:02 / cg" |
|
887 |
"Modified: / 15.6.1998 / 20:34:39 / cg" |
|
888 |
! |
|
889 |
||
890 |
description:aString in:anApplication |
|
891 |
"to allow fileIn of V'Age code. |
|
892 |
Set the description of the class." |
|
893 |
||
894 |
"/ since ST/X has no description, we could add it as a class-documentation |
|
895 |
"/ method under the selector #description. |
|
896 |
"/ for now, this is ignored. |
|
897 |
||
898 |
^ self. |
|
899 |
||
900 |
"Modified: / 15.6.1998 / 17:14:53 / cg" |
|
901 |
"Created: / 15.6.1998 / 20:34:02 / cg" |
|
902 |
! |
|
903 |
||
904 |
descriptionFor:aSelector is:aString |
|
905 |
"to allow fileIn of V'Age code. |
|
906 |
Set the description of the method which is installed under aSelector." |
|
907 |
||
908 |
"/ since ST/X has no description, we could add it as a class-documentation |
|
909 |
"/ method under the selector #description. |
|
910 |
"/ for now, this is ignored. |
|
911 |
||
5943
486397537382
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5833
diff
changeset
|
912 |
"/ |newString code| |
486397537382
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5833
diff
changeset
|
913 |
"/ |
486397537382
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5833
diff
changeset
|
914 |
"/ |
486397537382
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5833
diff
changeset
|
915 |
"/ newString := aString copy replaceAll:$" with:$'. |
486397537382
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5833
diff
changeset
|
916 |
"/ code := 'description |
486397537382
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5833
diff
changeset
|
917 |
"/" |
486397537382
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5833
diff
changeset
|
918 |
"/ ' , aString , ' |
486397537382
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5833
diff
changeset
|
919 |
"/"'. |
486397537382
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5833
diff
changeset
|
920 |
"/ self compile:code forClass:self class inCategory:#documentation |
3583 | 921 |
|
922 |
^ self. |
|
923 |
||
924 |
"Modified: / 15.6.1998 / 17:14:53 / cg" |
|
925 |
! |
|
926 |
||
927 |
initializeAfterLoad |
|
928 |
"this message is sent after fileIn of a V'Age class" |
|
929 |
||
930 |
self initialize |
|
931 |
||
932 |
"Modified: / 15.6.1998 / 20:35:58 / cg" |
|
933 |
"Created: / 15.6.1998 / 20:36:49 / cg" |
|
934 |
! ! |
|
935 |
||
10477 | 936 |
!ClassDescription methodsFor:'Compatibility-VW'! |
6621
c919ffc9b646
defneStatic (starting VW compatibility)
Claus Gittinger <cg@exept.de>
parents:
6620
diff
changeset
|
937 |
|
7606
5479f4699324
moved some stuff to Behavior
Claus Gittinger <cg@exept.de>
parents:
7330
diff
changeset
|
938 |
compile: aString classified: protocol attributes: attributes |
5479f4699324
moved some stuff to Behavior
Claus Gittinger <cg@exept.de>
parents:
7330
diff
changeset
|
939 |
"compile some method-code" |
5479f4699324
moved some stuff to Behavior
Claus Gittinger <cg@exept.de>
parents:
7330
diff
changeset
|
940 |
|
5479f4699324
moved some stuff to Behavior
Claus Gittinger <cg@exept.de>
parents:
7330
diff
changeset
|
941 |
|mthd| |
5479f4699324
moved some stuff to Behavior
Claus Gittinger <cg@exept.de>
parents:
7330
diff
changeset
|
942 |
|
5479f4699324
moved some stuff to Behavior
Claus Gittinger <cg@exept.de>
parents:
7330
diff
changeset
|
943 |
mthd := self compile: aString classified: protocol. |
5479f4699324
moved some stuff to Behavior
Claus Gittinger <cg@exept.de>
parents:
7330
diff
changeset
|
944 |
attributes notEmpty ifTrue:[ |
23008 | 945 |
attributes keysAndValuesDo:[:aK :aV | |
946 |
aK = 'package' ifTrue:[ |
|
947 |
"/ mthd package:aV |
|
948 |
] ifFalse:[ |
|
949 |
self proceedableError:(aK , '-attribute not yet supported'). |
|
950 |
]. |
|
951 |
]. |
|
7606
5479f4699324
moved some stuff to Behavior
Claus Gittinger <cg@exept.de>
parents:
7330
diff
changeset
|
952 |
]. |
5479f4699324
moved some stuff to Behavior
Claus Gittinger <cg@exept.de>
parents:
7330
diff
changeset
|
953 |
|
5479f4699324
moved some stuff to Behavior
Claus Gittinger <cg@exept.de>
parents:
7330
diff
changeset
|
954 |
^ mthd. |
23008 | 955 |
|
956 |
"Modified: / 24-05-2018 / 21:06:38 / Claus Gittinger" |
|
7606
5479f4699324
moved some stuff to Behavior
Claus Gittinger <cg@exept.de>
parents:
7330
diff
changeset
|
957 |
! |
5479f4699324
moved some stuff to Behavior
Claus Gittinger <cg@exept.de>
parents:
7330
diff
changeset
|
958 |
|
13677
bae322060152
added: #instVarIndexFor:ifAbsent:
Claus Gittinger <cg@exept.de>
parents:
13658
diff
changeset
|
959 |
instVarIndexFor:aVariableName ifAbsent:exceptionValue |
bae322060152
added: #instVarIndexFor:ifAbsent:
Claus Gittinger <cg@exept.de>
parents:
13658
diff
changeset
|
960 |
"alias for #instVarOffsetOf: for VW compatibility." |
bae322060152
added: #instVarIndexFor:ifAbsent:
Claus Gittinger <cg@exept.de>
parents:
13658
diff
changeset
|
961 |
|
bae322060152
added: #instVarIndexFor:ifAbsent:
Claus Gittinger <cg@exept.de>
parents:
13658
diff
changeset
|
962 |
|idx| |
bae322060152
added: #instVarIndexFor:ifAbsent:
Claus Gittinger <cg@exept.de>
parents:
13658
diff
changeset
|
963 |
|
15447 | 964 |
idx := self instVarIndexFor:aVariableName. |
13677
bae322060152
added: #instVarIndexFor:ifAbsent:
Claus Gittinger <cg@exept.de>
parents:
13658
diff
changeset
|
965 |
idx isNil ifTrue:[ ^ exceptionValue value ]. |
bae322060152
added: #instVarIndexFor:ifAbsent:
Claus Gittinger <cg@exept.de>
parents:
13658
diff
changeset
|
966 |
^ idx |
bae322060152
added: #instVarIndexFor:ifAbsent:
Claus Gittinger <cg@exept.de>
parents:
13658
diff
changeset
|
967 |
|
bae322060152
added: #instVarIndexFor:ifAbsent:
Claus Gittinger <cg@exept.de>
parents:
13658
diff
changeset
|
968 |
" |
bae322060152
added: #instVarIndexFor:ifAbsent:
Claus Gittinger <cg@exept.de>
parents:
13658
diff
changeset
|
969 |
Point instVarIndexFor:#x |
bae322060152
added: #instVarIndexFor:ifAbsent:
Claus Gittinger <cg@exept.de>
parents:
13658
diff
changeset
|
970 |
Point instVarIndexFor:#x ifAbsent:[123] 1 |
bae322060152
added: #instVarIndexFor:ifAbsent:
Claus Gittinger <cg@exept.de>
parents:
13658
diff
changeset
|
971 |
Point instVarIndexFor:#z ifAbsent:[123] |
bae322060152
added: #instVarIndexFor:ifAbsent:
Claus Gittinger <cg@exept.de>
parents:
13658
diff
changeset
|
972 |
" |
bae322060152
added: #instVarIndexFor:ifAbsent:
Claus Gittinger <cg@exept.de>
parents:
13658
diff
changeset
|
973 |
|
bae322060152
added: #instVarIndexFor:ifAbsent:
Claus Gittinger <cg@exept.de>
parents:
13658
diff
changeset
|
974 |
"Created: / 12-09-2011 / 08:44:19 / cg" |
22028 | 975 |
! |
976 |
||
977 |
shortName |
|
978 |
^ self nameWithoutPrefix |
|
6621
c919ffc9b646
defneStatic (starting VW compatibility)
Claus Gittinger <cg@exept.de>
parents:
6620
diff
changeset
|
979 |
! ! |
c919ffc9b646
defneStatic (starting VW compatibility)
Claus Gittinger <cg@exept.de>
parents:
6620
diff
changeset
|
980 |
|
1 | 981 |
!ClassDescription methodsFor:'accessing'! |
982 |
||
3621
d98d21976dec
had to move #sourceCodeForMethod up.
Claus Gittinger <cg@exept.de>
parents:
3616
diff
changeset
|
983 |
definition |
d98d21976dec
had to move #sourceCodeForMethod up.
Claus Gittinger <cg@exept.de>
parents:
3616
diff
changeset
|
984 |
"return an expression-string to define myself" |
d98d21976dec
had to move #sourceCodeForMethod up.
Claus Gittinger <cg@exept.de>
parents:
3616
diff
changeset
|
985 |
|
d98d21976dec
had to move #sourceCodeForMethod up.
Claus Gittinger <cg@exept.de>
parents:
3616
diff
changeset
|
986 |
|s| |
d98d21976dec
had to move #sourceCodeForMethod up.
Claus Gittinger <cg@exept.de>
parents:
3616
diff
changeset
|
987 |
|
20482 | 988 |
s := WriteStream on:''. |
3621
d98d21976dec
had to move #sourceCodeForMethod up.
Claus Gittinger <cg@exept.de>
parents:
3616
diff
changeset
|
989 |
self fileOutDefinitionOn:s. |
d98d21976dec
had to move #sourceCodeForMethod up.
Claus Gittinger <cg@exept.de>
parents:
3616
diff
changeset
|
990 |
^ s contents |
d98d21976dec
had to move #sourceCodeForMethod up.
Claus Gittinger <cg@exept.de>
parents:
3616
diff
changeset
|
991 |
|
d98d21976dec
had to move #sourceCodeForMethod up.
Claus Gittinger <cg@exept.de>
parents:
3616
diff
changeset
|
992 |
" |
8552 | 993 |
Object definition |
994 |
Point definition |
|
8551 | 995 |
Array definition |
996 |
ByteArray definition |
|
997 |
FloatArray definition |
|
998 |
OpenGLConstantImporter definition |
|
3621
d98d21976dec
had to move #sourceCodeForMethod up.
Claus Gittinger <cg@exept.de>
parents:
3616
diff
changeset
|
999 |
" |
d98d21976dec
had to move #sourceCodeForMethod up.
Claus Gittinger <cg@exept.de>
parents:
3616
diff
changeset
|
1000 |
|
d98d21976dec
had to move #sourceCodeForMethod up.
Claus Gittinger <cg@exept.de>
parents:
3616
diff
changeset
|
1001 |
"Created: / 19.6.1998 / 02:25:49 / cg" |
3687 | 1002 |
"Modified: / 29.7.1998 / 12:13:44 / cg" |
3621
d98d21976dec
had to move #sourceCodeForMethod up.
Claus Gittinger <cg@exept.de>
parents:
3616
diff
changeset
|
1003 |
! |
d98d21976dec
had to move #sourceCodeForMethod up.
Claus Gittinger <cg@exept.de>
parents:
3616
diff
changeset
|
1004 |
|
13627
6a6363394106
added: #definitionWithoutPackage
Claus Gittinger <cg@exept.de>
parents:
13599
diff
changeset
|
1005 |
definitionWithoutPackage |
6a6363394106
added: #definitionWithoutPackage
Claus Gittinger <cg@exept.de>
parents:
13599
diff
changeset
|
1006 |
"return an expression-string to define myself (but not the package)" |
6a6363394106
added: #definitionWithoutPackage
Claus Gittinger <cg@exept.de>
parents:
13599
diff
changeset
|
1007 |
|
6a6363394106
added: #definitionWithoutPackage
Claus Gittinger <cg@exept.de>
parents:
13599
diff
changeset
|
1008 |
^ String streamContents:[:s | |
6a6363394106
added: #definitionWithoutPackage
Claus Gittinger <cg@exept.de>
parents:
13599
diff
changeset
|
1009 |
self theNonMetaclass |
6a6363394106
added: #definitionWithoutPackage
Claus Gittinger <cg@exept.de>
parents:
13599
diff
changeset
|
1010 |
basicFileOutDefinitionOn:s |
6a6363394106
added: #definitionWithoutPackage
Claus Gittinger <cg@exept.de>
parents:
13599
diff
changeset
|
1011 |
withNameSpace:false |
6a6363394106
added: #definitionWithoutPackage
Claus Gittinger <cg@exept.de>
parents:
13599
diff
changeset
|
1012 |
withPackage:false |
6a6363394106
added: #definitionWithoutPackage
Claus Gittinger <cg@exept.de>
parents:
13599
diff
changeset
|
1013 |
] |
6a6363394106
added: #definitionWithoutPackage
Claus Gittinger <cg@exept.de>
parents:
13599
diff
changeset
|
1014 |
|
6a6363394106
added: #definitionWithoutPackage
Claus Gittinger <cg@exept.de>
parents:
13599
diff
changeset
|
1015 |
" |
6a6363394106
added: #definitionWithoutPackage
Claus Gittinger <cg@exept.de>
parents:
13599
diff
changeset
|
1016 |
Object definition |
6a6363394106
added: #definitionWithoutPackage
Claus Gittinger <cg@exept.de>
parents:
13599
diff
changeset
|
1017 |
Point definition |
6a6363394106
added: #definitionWithoutPackage
Claus Gittinger <cg@exept.de>
parents:
13599
diff
changeset
|
1018 |
Array definition |
6a6363394106
added: #definitionWithoutPackage
Claus Gittinger <cg@exept.de>
parents:
13599
diff
changeset
|
1019 |
ByteArray definition |
6a6363394106
added: #definitionWithoutPackage
Claus Gittinger <cg@exept.de>
parents:
13599
diff
changeset
|
1020 |
FloatArray definition |
6a6363394106
added: #definitionWithoutPackage
Claus Gittinger <cg@exept.de>
parents:
13599
diff
changeset
|
1021 |
OpenGLConstantImporter definition |
6a6363394106
added: #definitionWithoutPackage
Claus Gittinger <cg@exept.de>
parents:
13599
diff
changeset
|
1022 |
" |
6a6363394106
added: #definitionWithoutPackage
Claus Gittinger <cg@exept.de>
parents:
13599
diff
changeset
|
1023 |
|
6a6363394106
added: #definitionWithoutPackage
Claus Gittinger <cg@exept.de>
parents:
13599
diff
changeset
|
1024 |
"Created: / 31-08-2011 / 09:26:09 / cg" |
6a6363394106
added: #definitionWithoutPackage
Claus Gittinger <cg@exept.de>
parents:
13599
diff
changeset
|
1025 |
! |
6a6363394106
added: #definitionWithoutPackage
Claus Gittinger <cg@exept.de>
parents:
13599
diff
changeset
|
1026 |
|
620 | 1027 |
instVarAtOffset:index |
1028 |
"return the name of the instance variable at index" |
|
1029 |
||
1030 |
^ self allInstanceVariableNames at:index |
|
1031 |
! |
|
1032 |
||
15447 | 1033 |
instVarIndexFor:aVariableName |
1034 |
"return the index (as used in instVarAt:/instVarAt:put:) of a named instance |
|
1035 |
variable (1..instSize) for valid variable names, nil for illegal names." |
|
1036 |
||
1037 |
|i cls vars| |
|
1038 |
||
1039 |
cls := self. |
|
1040 |
[cls notNil] whileTrue:[ |
|
1041 |
vars := cls instVarNames. |
|
1042 |
i := vars indexOf:aVariableName. |
|
1043 |
i ~~ 0 ifTrue:[ |
|
1044 |
^ (cls superclass instSize) + i |
|
1045 |
]. |
|
1046 |
cls := cls superclass |
|
1047 |
]. |
|
1048 |
^ nil |
|
1049 |
||
1050 |
" |
|
1051 |
Point instVarIndexFor:'x' |
|
1052 |
View instVarIndexFor:'paint' |
|
1053 |
Button instVarIndexFor:'logo' |
|
1054 |
" |
|
1055 |
||
1056 |
"Modified: 23.8.1997 / 16:59:15 / cg" |
|
1057 |
! |
|
1058 |
||
620 | 1059 |
instVarNames |
16044 | 1060 |
"return a collection of the instance variable name-strings. |
1061 |
Traditionally, this was called instVarNames, but newer versions of squeak |
|
1062 |
seem to have changed to use instanceVariableNames. |
|
1063 |
So you probably should use the alias" |
|
620 | 1064 |
|
1065 |
instvars isNil ifTrue:[ |
|
11872 | 1066 |
^ #() |
620 | 1067 |
]. |
2882
f133d996dd33
transparently convert instVarString to collection of words
Claus Gittinger <cg@exept.de>
parents:
2701
diff
changeset
|
1068 |
instvars isString ifTrue:[ |
20516 | 1069 |
instvars isEmpty ifTrue:[ |
1070 |
instvars := #(). |
|
1071 |
] ifFalse:[ |
|
1072 |
instvars := instvars asCollectionOfWords collect:[:varName| varName asSymbol] as:Array. |
|
1073 |
]. |
|
2882
f133d996dd33
transparently convert instVarString to collection of words
Claus Gittinger <cg@exept.de>
parents:
2701
diff
changeset
|
1074 |
]. |
f133d996dd33
transparently convert instVarString to collection of words
Claus Gittinger <cg@exept.de>
parents:
2701
diff
changeset
|
1075 |
|
f133d996dd33
transparently convert instVarString to collection of words
Claus Gittinger <cg@exept.de>
parents:
2701
diff
changeset
|
1076 |
^ instvars |
620 | 1077 |
|
1078 |
" |
|
8551 | 1079 |
Point instVarNames |
1080 |
SortedCollection instVarNames |
|
1081 |
SortedCollection allInstVarNames |
|
620 | 1082 |
" |
2882
f133d996dd33
transparently convert instVarString to collection of words
Claus Gittinger <cg@exept.de>
parents:
2701
diff
changeset
|
1083 |
|
2889 | 1084 |
"Modified: 22.8.1997 / 17:43:05 / cg" |
620 | 1085 |
! |
1086 |
||
1087 |
instVarOffsetOf:aVariableName |
|
20692 | 1088 |
<resource: #obsolete> |
620 | 1089 |
"return the index (as used in instVarAt:/instVarAt:put:) of a named instance |
15447 | 1090 |
variable (1..instSize) for valid variable names, nil for illegal names. |
1091 |
This was the original ST/X's method for this functionality; senders have been changed to use instVarIndexFor:. |
|
1092 |
Kept for backward compatibility; please use instVarIndexFor: for VW and Squeak compatibility" |
|
1093 |
||
20692 | 1094 |
self obsoleteMethodWarning. |
1095 |
||
15447 | 1096 |
^ self instVarIndexFor:aVariableName |
2891 | 1097 |
|
1098 |
"Modified: 23.8.1997 / 16:59:15 / cg" |
|
620 | 1099 |
! |
1100 |
||
1101 |
instanceVariableOffsets |
|
1102 |
"returns a dictionary containing the instance variable index |
|
1103 |
for each instVar name" |
|
1104 |
||
1105 |
|dict index| |
|
1106 |
||
1107 |
index := 0. dict := Dictionary new. |
|
1108 |
self allInstVarNames do:[:nm | index := index + 1. dict at:nm put:index]. |
|
1109 |
^ dict |
|
1110 |
||
1111 |
" |
|
8551 | 1112 |
Point instanceVariableOffsets |
1113 |
GraphicsContext instanceVariableOffsets |
|
620 | 1114 |
" |
1115 |
! |
|
1116 |
||
1117 |
instanceVariableString |
|
1118 |
"return a string of the instance variable names" |
|
1119 |
||
1120 |
instvars isNil ifTrue:[^ '']. |
|
2882
f133d996dd33
transparently convert instVarString to collection of words
Claus Gittinger <cg@exept.de>
parents:
2701
diff
changeset
|
1121 |
instvars isString ifTrue:[ |
3918
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
1122 |
^ instvars |
2882
f133d996dd33
transparently convert instVarString to collection of words
Claus Gittinger <cg@exept.de>
parents:
2701
diff
changeset
|
1123 |
]. |
f133d996dd33
transparently convert instVarString to collection of words
Claus Gittinger <cg@exept.de>
parents:
2701
diff
changeset
|
1124 |
|
f133d996dd33
transparently convert instVarString to collection of words
Claus Gittinger <cg@exept.de>
parents:
2701
diff
changeset
|
1125 |
^ instvars asStringWith:(Character space) |
620 | 1126 |
|
1127 |
" |
|
8551 | 1128 |
Point instanceVariableString |
620 | 1129 |
" |
2882
f133d996dd33
transparently convert instVarString to collection of words
Claus Gittinger <cg@exept.de>
parents:
2701
diff
changeset
|
1130 |
|
f133d996dd33
transparently convert instVarString to collection of words
Claus Gittinger <cg@exept.de>
parents:
2701
diff
changeset
|
1131 |
"Modified: 22.8.1997 / 14:59:14 / cg" |
620 | 1132 |
! |
1133 |
||
7658
b009bc99dd47
oops - Metaclass needs topNameSpace
Claus Gittinger <cg@exept.de>
parents:
7657
diff
changeset
|
1134 |
nameSpace |
19258 | 1135 |
"should be redefined in concrete subclass(es)" |
1136 |
||
1137 |
^ nil |
|
7658
b009bc99dd47
oops - Metaclass needs topNameSpace
Claus Gittinger <cg@exept.de>
parents:
7657
diff
changeset
|
1138 |
! |
b009bc99dd47
oops - Metaclass needs topNameSpace
Claus Gittinger <cg@exept.de>
parents:
7657
diff
changeset
|
1139 |
|
19926 | 1140 |
projectDefinitionClass |
1141 |
"return the project definition of the classes' package. |
|
1142 |
Here, nil is returned. Only full classes have one." |
|
1143 |
||
1144 |
^ nil |
|
1145 |
! |
|
1146 |
||
2671
e35b38211d4a
had to move #renameCategory: (stefans change)
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
1147 |
renameCategory:oldCategory to:newCategory |
e35b38211d4a
had to move #renameCategory: (stefans change)
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
1148 |
"{ Pragma: +optSpace }" |
e35b38211d4a
had to move #renameCategory: (stefans change)
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
1149 |
|
e35b38211d4a
had to move #renameCategory: (stefans change)
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
1150 |
"rename a category (changes category of those methods). |
e35b38211d4a
had to move #renameCategory: (stefans change)
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
1151 |
Appends a change record and notifies dependents." |
e35b38211d4a
had to move #renameCategory: (stefans change)
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
1152 |
|
e35b38211d4a
had to move #renameCategory: (stefans change)
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
1153 |
|any| |
e35b38211d4a
had to move #renameCategory: (stefans change)
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
1154 |
|
e35b38211d4a
had to move #renameCategory: (stefans change)
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
1155 |
any := false. |
e35b38211d4a
had to move #renameCategory: (stefans change)
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
1156 |
self methodDictionary do:[:aMethod | |
8551 | 1157 |
aMethod category = oldCategory ifTrue:[ |
1158 |
aMethod category:newCategory. |
|
1159 |
any := true. |
|
1160 |
] |
|
2671
e35b38211d4a
had to move #renameCategory: (stefans change)
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
1161 |
]. |
e35b38211d4a
had to move #renameCategory: (stefans change)
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
1162 |
any ifTrue:[ |
8551 | 1163 |
self addChangeRecordForRenameCategory:oldCategory to:newCategory. |
2671
e35b38211d4a
had to move #renameCategory: (stefans change)
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
1164 |
] |
e35b38211d4a
had to move #renameCategory: (stefans change)
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
1165 |
|
e35b38211d4a
had to move #renameCategory: (stefans change)
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
1166 |
"Modified: 12.6.1996 / 11:49:08 / stefan" |
e35b38211d4a
had to move #renameCategory: (stefans change)
Claus Gittinger <cg@exept.de>
parents:
2666
diff
changeset
|
1167 |
"Created: 3.6.1997 / 11:55:05 / cg" |
18458 | 1168 |
! |
1169 |
||
22818 | 1170 |
sharedPoolNamed:aPoolName |
1171 |
"this returns a resolved real pool (i.e. a PoolDictionary), |
|
1172 |
This cares for the namespace in which the class is located |
|
1173 |
||
1174 |
Notice, that for source compatibility with other smalltalks, |
|
1175 |
the pool's namespace in a class definition is not in the pool name, |
|
1176 |
as to make it is easy to fileIn an alien class into an ST/X namespace, |
|
1177 |
and also to allow filing out smalltalk-namespace classes for import into |
|
1178 |
another smalltalk. |
|
1179 |
However, then we must resolve the actual pool later - i.e. here" |
|
1180 |
||
1181 |
|pool ns ns2| |
|
1182 |
||
1183 |
ns := self nameSpace. |
|
1184 |
ns2 := self topNameSpace. |
|
1185 |
||
1186 |
(ns notNil and:[ns ~= Smalltalk]) ifTrue:[ |
|
1187 |
(pool := ns classNamed:aPoolName) notNil ifTrue:[^ pool]. |
|
1188 |
]. |
|
1189 |
(ns2 notNil and:[ns2 ~~ ns and:[ns2 ~= Smalltalk]]) ifTrue:[ |
|
1190 |
(pool := ns2 classNamed:aPoolName) notNil ifTrue:[^ pool]. |
|
1191 |
]. |
|
1192 |
pool := Smalltalk classNamed:aPoolName. |
|
1193 |
pool isNil ifTrue:[ |
|
1194 |
Logger notNil ifTrue:[ Logger warning:('Warning: no such pool: ',aPoolName)]. |
|
1195 |
]. |
|
1196 |
^ pool. |
|
1197 |
" |
|
1198 |
an example for a pool inside a namespace (in this case: a private pool): |
|
1199 |
UnixOperatingSystem::ELFFileHeader sharedPools |
|
1200 |
||
1201 |
Smalltalk allClasses |
|
1202 |
collect:[:cls | cls -> cls sharedPools] |
|
1203 |
thenSelect:[:assoc | assoc value notEmptyOrNil]. |
|
1204 |
||
1205 |
OSI::ASN1_Coder sharedPoolNames |
|
1206 |
ZipArchive sharedPools |
|
1207 |
Croquet::OpenGL sharedPools |
|
1208 |
OpenGLRenderingContext sharedPools |
|
1209 |
Character sharedPools |
|
1210 |
Win32OperatingSystem sharedPools |
|
1211 |
" |
|
1212 |
||
1213 |
"Modified: / 29-05-2012 / 12:09:27 / cg" |
|
1214 |
! |
|
1215 |
||
18458 | 1216 |
sharedPoolNames |
22811 | 1217 |
"this returns a collection of the plain (non-namespace aware) pool names" |
1218 |
||
18458 | 1219 |
^ #() |
19761 | 1220 |
! |
1221 |
||
22814 | 1222 |
sharedPools |
1223 |
"this returns a collection of the real pools (i.e. the PoolDictionaries), |
|
1224 |
not their names (see sharedPoolNames). |
|
1225 |
This cares for the namespace in which the class is located |
|
1226 |
||
1227 |
Notice, that for source compatibility with other smalltalks, |
|
1228 |
the namespace is not in the pool name, as to make it is easy to fileIn an alien class |
|
1229 |
into an ST/X namespace. |
|
1230 |
However, then we must resolve the actual pool later - i.e. here" |
|
1231 |
||
22818 | 1232 |
|poolNames| |
22814 | 1233 |
|
1234 |
poolNames := self sharedPoolNames. |
|
1235 |
poolNames isEmptyOrNil ifTrue:[^ #() ]. |
|
1236 |
||
22818 | 1237 |
^ poolNames |
1238 |
collect:[:eachName | self sharedPoolNamed:eachName] |
|
22814 | 1239 |
thenSelect:[:pool | pool notNil]. |
1240 |
||
1241 |
" |
|
1242 |
an example for a pool inside a namespace (in this case: a private pool): |
|
1243 |
UnixOperatingSystem::ELFFileHeader sharedPools |
|
1244 |
||
1245 |
Smalltalk allClasses |
|
1246 |
collect:[:cls | cls -> cls sharedPools] |
|
1247 |
thenSelect:[:assoc | assoc value notEmptyOrNil]. |
|
1248 |
||
1249 |
OSI::ASN1_Coder sharedPoolNames |
|
1250 |
ZipArchive sharedPools |
|
1251 |
Croquet::OpenGL sharedPools |
|
1252 |
OpenGLRenderingContext sharedPools |
|
1253 |
Character sharedPools |
|
1254 |
Win32OperatingSystem sharedPools |
|
1255 |
" |
|
1256 |
||
1257 |
"Modified: / 29-05-2012 / 12:09:27 / cg" |
|
1258 |
! |
|
1259 |
||
19761 | 1260 |
typeOfClassVarNamed:classVarName |
1261 |
"option to return a collection of types which are considered |
|
1262 |
legal for classVarName. |
|
19944 | 1263 |
This is pure documentation, and has (currently) no semantic implications. |
1264 |
If present, it is used by the code completer's type inferer, |
|
1265 |
to make better guesses. |
|
19761 | 1266 |
Subclasses may redefine it to return a class, interface or a set of classes." |
1267 |
||
1268 |
^ nil |
|
1269 |
! |
|
1270 |
||
1271 |
typeOfInstVarNamed:instVarName |
|
1272 |
"option to return a collection of types which are considered |
|
1273 |
legal for instVarName. |
|
19944 | 1274 |
This is pure documentation, and has (currently) no semantic implications. |
1275 |
If present, it is used by the code completer's type inferer, |
|
1276 |
to make better guesses. |
|
19761 | 1277 |
Subclasses may redefine it to return a class, interface or a set of classes." |
1278 |
||
1279 |
^ nil |
|
1280 |
||
1281 |
" |
|
1282 |
Class typeOfInstVarNamed:'instSize' -> SmallInteger |
|
1283 |
" |
|
1 | 1284 |
! ! |
10 | 1285 |
|
5237
ac92ad320972
changeSet entry for category rename
Claus Gittinger <cg@exept.de>
parents:
5216
diff
changeset
|
1286 |
!ClassDescription methodsFor:'adding & removing'! |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1287 |
|
2676
38d61ed0cf40
stefan (sigh) .... must care for metaClasses changeRecords
Claus Gittinger <cg@exept.de>
parents:
2671
diff
changeset
|
1288 |
addSelector:newSelector withMethod:newMethod |
38d61ed0cf40
stefan (sigh) .... must care for metaClasses changeRecords
Claus Gittinger <cg@exept.de>
parents:
2671
diff
changeset
|
1289 |
"add the method given by 2nd argument under the selector given by |
8551 | 1290 |
1st argument to the methodDictionary. |
2676
38d61ed0cf40
stefan (sigh) .... must care for metaClasses changeRecords
Claus Gittinger <cg@exept.de>
parents:
2671
diff
changeset
|
1291 |
Append a change record to the changes file and tell dependents." |
38d61ed0cf40
stefan (sigh) .... must care for metaClasses changeRecords
Claus Gittinger <cg@exept.de>
parents:
2671
diff
changeset
|
1292 |
|
3067 | 1293 |
|oldMethod oldPackage newPackage| |
2676
38d61ed0cf40
stefan (sigh) .... must care for metaClasses changeRecords
Claus Gittinger <cg@exept.de>
parents:
2671
diff
changeset
|
1294 |
|
38d61ed0cf40
stefan (sigh) .... must care for metaClasses changeRecords
Claus Gittinger <cg@exept.de>
parents:
2671
diff
changeset
|
1295 |
oldMethod := self compiledMethodAt:newSelector. |
38d61ed0cf40
stefan (sigh) .... must care for metaClasses changeRecords
Claus Gittinger <cg@exept.de>
parents:
2671
diff
changeset
|
1296 |
|
38d61ed0cf40
stefan (sigh) .... must care for metaClasses changeRecords
Claus Gittinger <cg@exept.de>
parents:
2671
diff
changeset
|
1297 |
CatchMethodRedefinitions ifTrue:[ |
8837
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1298 |
"check for attempts to redefine a method |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1299 |
in a different package. Signal a resumable error if so. |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1300 |
This allows tracing redefinitions of existing system methods |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1301 |
when filing in alien code .... |
8864 | 1302 |
(which we may want to forbid sometimes) |
8837
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1303 |
" |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1304 |
oldMethod notNil ifTrue:[ |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1305 |
oldPackage := oldMethod package. |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1306 |
newPackage := newMethod package. |
12634
7895713eaf31
changed: #addSelector:withMethod:
Claus Gittinger <cg@exept.de>
parents:
12580
diff
changeset
|
1307 |
(oldPackage ~= newPackage and:[oldPackage ~= PackageId noProjectID]) ifTrue:[ |
8866
a3a1c586310f
Fix action after methodRedefinitionNotification
Stefan Vogel <sv@exept.de>
parents:
8864
diff
changeset
|
1308 |
|answer| |
8837
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1309 |
" |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1310 |
attempt to redefine an existing method, which was |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1311 |
defined in another package (see oldPackage vs. newPackage). |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1312 |
If you continue in the debugger, the new method gets installed. |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1313 |
Otherwise, the existing (old) method remains valid. |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1314 |
|
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1315 |
This check was added to help prevent accidental modifications |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1316 |
of system code - especially, when alien code is filedIn. |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1317 |
After you became familiar with the system, may want to disable this |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1318 |
check if it becomes too annoying (and only turn it on |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1319 |
temporarily, when filing in unknown code-files). |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1320 |
|
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1321 |
You can turn off the catching of redefinitions by setting |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1322 |
my classVariable |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1323 |
CatchMethodRedefinitions |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1324 |
to false. |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1325 |
(also found in the Launchers 'settings-compilation' menu) |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1326 |
" |
8866
a3a1c586310f
Fix action after methodRedefinitionNotification
Stefan Vogel <sv@exept.de>
parents:
8864
diff
changeset
|
1327 |
answer := Class methodRedefinitionNotification |
a3a1c586310f
Fix action after methodRedefinitionNotification
Stefan Vogel <sv@exept.de>
parents:
8864
diff
changeset
|
1328 |
raiseRequestWith:(oldMethod -> newMethod) |
a3a1c586310f
Fix action after methodRedefinitionNotification
Stefan Vogel <sv@exept.de>
parents:
8864
diff
changeset
|
1329 |
errorString:('redefinition of method: ' , self name , '>>' , newSelector). |
a3a1c586310f
Fix action after methodRedefinitionNotification
Stefan Vogel <sv@exept.de>
parents:
8864
diff
changeset
|
1330 |
|
a3a1c586310f
Fix action after methodRedefinitionNotification
Stefan Vogel <sv@exept.de>
parents:
8864
diff
changeset
|
1331 |
answer == #keep ifTrue:[ |
a3a1c586310f
Fix action after methodRedefinitionNotification
Stefan Vogel <sv@exept.de>
parents:
8864
diff
changeset
|
1332 |
"accept new method definition but keep old package" |
8837
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1333 |
newMethod setPackage:oldMethod package |
8866
a3a1c586310f
Fix action after methodRedefinitionNotification
Stefan Vogel <sv@exept.de>
parents:
8864
diff
changeset
|
1334 |
] ifFalse:[answer ~~ #continue ifTrue:[ |
a3a1c586310f
Fix action after methodRedefinitionNotification
Stefan Vogel <sv@exept.de>
parents:
8864
diff
changeset
|
1335 |
"skip this method" |
a3a1c586310f
Fix action after methodRedefinitionNotification
Stefan Vogel <sv@exept.de>
parents:
8864
diff
changeset
|
1336 |
^ nil |
a3a1c586310f
Fix action after methodRedefinitionNotification
Stefan Vogel <sv@exept.de>
parents:
8864
diff
changeset
|
1337 |
]]. |
a3a1c586310f
Fix action after methodRedefinitionNotification
Stefan Vogel <sv@exept.de>
parents:
8864
diff
changeset
|
1338 |
"if continued, install as usual - and use new package" |
8837
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1339 |
] |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1340 |
] |
2676
38d61ed0cf40
stefan (sigh) .... must care for metaClasses changeRecords
Claus Gittinger <cg@exept.de>
parents:
2671
diff
changeset
|
1341 |
]. |
38d61ed0cf40
stefan (sigh) .... must care for metaClasses changeRecords
Claus Gittinger <cg@exept.de>
parents:
2671
diff
changeset
|
1342 |
|
11575 | 1343 |
(super addSelector:newSelector withMethod:newMethod) ifTrue:[ |
14702 | 1344 |
"/ only write change records for changes to non-anonymous classes |
14712 | 1345 |
self theNonMetaclass containingNameSpace notNil ifTrue:[ |
20554 | 1346 |
"/ just in case addSelector:withMethod: was redefined to ignore this |
1347 |
newMethod selector == newSelector ifTrue:[ |
|
1348 |
self addChangeRecordForMethod:newMethod fromOld:oldMethod. |
|
1349 |
] |
|
14702 | 1350 |
] |
11575 | 1351 |
]. |
2676
38d61ed0cf40
stefan (sigh) .... must care for metaClasses changeRecords
Claus Gittinger <cg@exept.de>
parents:
2671
diff
changeset
|
1352 |
|
9561
558e31b007d5
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
9527
diff
changeset
|
1353 |
"Modified: / 09-09-1996 / 22:39:32 / stefan" |
558e31b007d5
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
9527
diff
changeset
|
1354 |
"Created: / 04-06-1997 / 14:47:10 / cg" |
558e31b007d5
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
9527
diff
changeset
|
1355 |
"Modified: / 17-08-2006 / 13:54:00 / cg" |
2676
38d61ed0cf40
stefan (sigh) .... must care for metaClasses changeRecords
Claus Gittinger <cg@exept.de>
parents:
2671
diff
changeset
|
1356 |
! |
38d61ed0cf40
stefan (sigh) .... must care for metaClasses changeRecords
Claus Gittinger <cg@exept.de>
parents:
2671
diff
changeset
|
1357 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1358 |
basicAddSelector:newSelector withMethod:newMethod |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1359 |
"add the method given by 2nd argument under the selector given by |
8551 | 1360 |
1st argument to the methodDictionary. |
1361 |
This does NOT append a change record to the changes file and tell |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1362 |
dependents. Also, no methodHistory is kept or redefinition is checked." |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1363 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1364 |
super addSelector:newSelector withMethod:newMethod |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1365 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1366 |
"Created: 2.4.1997 / 01:01:08 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1367 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1368 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1369 |
removeSelector:aSelector |
8551 | 1370 |
"remove the selector, aSelector and its associated method |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1371 |
from the methodDictionary. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1372 |
Append a change record to the changes file and tell dependents." |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1373 |
|
4358 | 1374 |
|oldMethod| |
1375 |
||
6746
8bbd639df663
removeSelector change: remember methods previous version
Claus Gittinger <cg@exept.de>
parents:
6732
diff
changeset
|
1376 |
oldMethod := self compiledMethodAt:aSelector. |
8bbd639df663
removeSelector change: remember methods previous version
Claus Gittinger <cg@exept.de>
parents:
6732
diff
changeset
|
1377 |
|
4358 | 1378 |
MethodHistory notNil ifTrue:[ |
12884 | 1379 |
oldMethod notNil ifTrue:[ |
1380 |
MethodHistory add:(Array with:#methodRemove with:oldMethod). |
|
1381 |
(MethodHistorySize notNil and:[MethodHistory size > MethodHistorySize]) ifTrue:[ |
|
1382 |
MethodHistory removeFirst. |
|
1383 |
] |
|
1384 |
] |
|
4358 | 1385 |
]. |
1386 |
||
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1387 |
(super removeSelector:aSelector) ifTrue:[ |
14702 | 1388 |
"/ only write change records for changes to non-anonymous classes |
14712 | 1389 |
self theNonMetaclass containingNameSpace notNil ifTrue:[ |
14702 | 1390 |
self addChangeRecordForRemoveSelector:aSelector fromOld:oldMethod. |
1391 |
"/ |
|
1392 |
"/ also notify a change of mySelf; |
|
1393 |
"/ |
|
1394 |
self changed:#methodDictionary with:aSelector. |
|
1395 |
||
1396 |
"/ |
|
1397 |
"/ also notify a change of Smalltalk; |
|
1398 |
"/ this allows a dependent of Smalltalk to watch all class |
|
1399 |
"/ changes (no need for observing all classes) |
|
21422 | 1400 |
"/ - this allows for watchers to find out if it's a new method or a method-change |
14702 | 1401 |
"/ |
1402 |
MethodRemoveChangeNotificationParameter notNil ifTrue:[ |
|
1403 |
Smalltalk changed:#methodInClassRemoved with:(MethodRemoveChangeNotificationParameter changeClass:self changeSelector:aSelector). |
|
1404 |
] |
|
12885 | 1405 |
] |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1406 |
] |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1407 |
|
21422 | 1408 |
"Modified: / 08-01-1997 / 23:03:49 / cg" |
1409 |
"Created: / 02-04-1997 / 00:59:29 / stefan" |
|
1410 |
"Modified (comment): / 13-02-2017 / 19:58:18 / cg" |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1411 |
! ! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1412 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1413 |
!ClassDescription methodsFor:'c function interfacing'! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1414 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1415 |
cInterfaceFunction:selector calling:cFunctionNameString args:argTypeArray returning:returnType |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1416 |
"{ Pragma: +optSpace }" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1417 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1418 |
"create an interface to an existing (i.e. already linked in) c function. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1419 |
The function can be called by sending selector to the receiver class. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1420 |
The c-function has the name cFunctionNameString, and expects parameters as specified in |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1421 |
argTypeArray. The functions return value has a type as specified by returnType. |
8551 | 1422 |
WARNING: |
3918
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
1423 |
this interface is EXPERIMENTAL - it may change or even be removed." |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1424 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1425 |
StubGenerator isNil ifTrue:[ |
3918
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
1426 |
^ self error:'this system does not support dynamic C Interface functions'. |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1427 |
]. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1428 |
|
8551 | 1429 |
StubGenerator |
1430 |
createStubFor:selector |
|
1431 |
calling:cFunctionNameString |
|
1432 |
args:argTypeArray |
|
3918
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
1433 |
returning:returnType |
8551 | 1434 |
in:self |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1435 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1436 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1437 |
Object subclass:#CInterface |
3918
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
1438 |
instanceVariableNames:'' |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
1439 |
classVariableNames:'' |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
1440 |
poolDictionaries:'' |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
1441 |
category:'Examples'. |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1442 |
|
8551 | 1443 |
CInterface cInterfaceFunction:#printfOn:format:withFloat: |
1444 |
calling:'fprintf' |
|
1445 |
args:#(ExternalStream String Float) |
|
3918
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
1446 |
returning:#SmallInteger. |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1447 |
|
8551 | 1448 |
CInterface printfOn:Stdout format:'this is a float: %g' withFloat:(Float pi). Stdout cr |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1449 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1450 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1451 |
"Modified: 5.1.1997 / 19:58:22 / cg" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1452 |
"Created: 2.4.1997 / 00:57:40 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1453 |
! ! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1454 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1455 |
!ClassDescription methodsFor:'changes management'! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1456 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1457 |
addChangeRecordForMethod:aMethod |
14706 | 1458 |
"{ Pragma: +optSpace }" |
1459 |
||
14702 | 1460 |
<resource: #obsolete> |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1461 |
|
14702 | 1462 |
self obsoleteMethodWarning:'use addChangeRecordForMethod:fromOld:'. |
1463 |
||
5553
1740d3ae50ff
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
5515
diff
changeset
|
1464 |
"add a method-change-record to the changes file and to the current changeSet" |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1465 |
|
4056
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
1466 |
UpdateChangeFileQuerySignal query ifTrue:[ |
14702 | 1467 |
self writingChangePerform:#addChangeRecordForMethod:to: with:aMethod. |
6097 | 1468 |
]. |
1469 |
||
1470 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1471 |
Project notNil ifTrue:[ |
|
14702 | 1472 |
UpdateChangeListQuerySignal query ifTrue:[ |
1473 |
Project addMethodChange:aMethod in:self |
|
1474 |
] |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1475 |
] |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1476 |
|
4056
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
1477 |
"Modified: / 20.1.1997 / 12:36:02 / cg" |
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
1478 |
"Created: / 2.4.1997 / 01:02:16 / stefan" |
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
1479 |
"Modified: / 18.3.1999 / 18:16:41 / stefan" |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1480 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1481 |
|
5553
1740d3ae50ff
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
5515
diff
changeset
|
1482 |
addChangeRecordForMethod:aMethod fromOld:oldMethod |
1740d3ae50ff
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
5515
diff
changeset
|
1483 |
"{ Pragma: +optSpace }" |
1740d3ae50ff
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
5515
diff
changeset
|
1484 |
|
1740d3ae50ff
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
5515
diff
changeset
|
1485 |
"add a method-change-record to the changes file and to the current changeSet" |
1740d3ae50ff
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
5515
diff
changeset
|
1486 |
|
1740d3ae50ff
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
5515
diff
changeset
|
1487 |
UpdateChangeFileQuerySignal query ifTrue:[ |
8551 | 1488 |
self writingChangePerform:#addChangeRecordForMethod:to: with:aMethod. |
6097 | 1489 |
]. |
1490 |
||
1491 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1492 |
Project notNil ifTrue:[ |
|
8551 | 1493 |
UpdateChangeListQuerySignal query ifTrue:[ |
1494 |
Project addMethodChange:aMethod fromOld:oldMethod in:self |
|
1495 |
] |
|
5553
1740d3ae50ff
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
5515
diff
changeset
|
1496 |
] |
1740d3ae50ff
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
5515
diff
changeset
|
1497 |
|
1740d3ae50ff
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
5515
diff
changeset
|
1498 |
"Modified: / 20.1.1997 / 12:36:02 / cg" |
1740d3ae50ff
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
5515
diff
changeset
|
1499 |
"Created: / 2.4.1997 / 01:02:16 / stefan" |
1740d3ae50ff
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
5515
diff
changeset
|
1500 |
"Modified: / 18.3.1999 / 18:16:41 / stefan" |
1740d3ae50ff
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
5515
diff
changeset
|
1501 |
! |
1740d3ae50ff
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
5515
diff
changeset
|
1502 |
|
5237
ac92ad320972
changeSet entry for category rename
Claus Gittinger <cg@exept.de>
parents:
5216
diff
changeset
|
1503 |
addChangeRecordForMethodCategory:aMethodOrSelector category:aString |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1504 |
"{ Pragma: +optSpace }" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1505 |
|
5237
ac92ad320972
changeSet entry for category rename
Claus Gittinger <cg@exept.de>
parents:
5216
diff
changeset
|
1506 |
|mthd| |
ac92ad320972
changeSet entry for category rename
Claus Gittinger <cg@exept.de>
parents:
5216
diff
changeset
|
1507 |
|
5553
1740d3ae50ff
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
5515
diff
changeset
|
1508 |
"add a methodCategory-change-record to the changes file and to the current changeSet" |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1509 |
|
4056
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
1510 |
UpdateChangeFileQuerySignal query ifTrue:[ |
8551 | 1511 |
(mthd := aMethodOrSelector) isSymbol ifTrue:[ |
1512 |
mthd := self compiledMethodAt:aMethodOrSelector |
|
1513 |
]. |
|
1514 |
self writingChangeDo:[:aStream | |
|
1515 |
self addChangeRecordForMethodCategory:mthd category:aString to:aStream. |
|
1516 |
]. |
|
6097 | 1517 |
]. |
1518 |
||
1519 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1520 |
Project notNil ifTrue:[ |
|
8551 | 1521 |
UpdateChangeListQuerySignal query ifTrue:[ |
1522 |
Project addMethodCategoryChange:mthd category:aString in:self |
|
1523 |
] |
|
6097 | 1524 |
]. |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1525 |
|
4056
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
1526 |
"Modified: / 18.3.1999 / 18:16:50 / stefan" |
5237
ac92ad320972
changeSet entry for category rename
Claus Gittinger <cg@exept.de>
parents:
5216
diff
changeset
|
1527 |
"Modified: / 6.2.2000 / 17:35:01 / cg" |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1528 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1529 |
|
10060 | 1530 |
addChangeRecordForMethodPackage:aMethodOrSelector package:aPackageSymbol |
1531 |
"{ Pragma: +optSpace }" |
|
1532 |
||
1533 |
|mthd| |
|
1534 |
||
1535 |
"add a methodPackage-change-record to the changes file and to the current changeSet" |
|
1536 |
||
1537 |
UpdateChangeFileQuerySignal query ifTrue:[ |
|
1538 |
(mthd := aMethodOrSelector) isSymbol ifTrue:[ |
|
1539 |
mthd := self compiledMethodAt:aMethodOrSelector |
|
1540 |
]. |
|
1541 |
self writingChangeDo:[:aStream | |
|
1542 |
self addChangeRecordForMethodPackage:mthd package:aPackageSymbol to:aStream. |
|
1543 |
]. |
|
1544 |
]. |
|
1545 |
||
1546 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1547 |
Project notNil ifTrue:[ |
|
1548 |
UpdateChangeListQuerySignal query ifTrue:[ |
|
1549 |
Project addMethodPackageChange:mthd package:aPackageSymbol in:self |
|
1550 |
] |
|
1551 |
]. |
|
1552 |
||
1553 |
"Created: / 09-10-2006 / 13:52:06 / cg" |
|
1554 |
! |
|
1555 |
||
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1556 |
addChangeRecordForMethodPrivacy:aMethod |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1557 |
"{ Pragma: +optSpace }" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1558 |
|
5553
1740d3ae50ff
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
5515
diff
changeset
|
1559 |
"add a method-privacy-change-record to the changes file and to the current changeSet" |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1560 |
|
4056
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
1561 |
UpdateChangeFileQuerySignal query ifTrue:[ |
8551 | 1562 |
self writingChangePerform:#addChangeRecordForMethodPrivacy:to: with:aMethod. |
6097 | 1563 |
]. |
1564 |
||
1565 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1566 |
Project notNil ifTrue:[ |
|
8551 | 1567 |
UpdateChangeListQuerySignal query ifTrue:[ |
1568 |
Project addMethodPrivacyChange:aMethod in:self |
|
1569 |
] |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1570 |
] |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1571 |
|
4056
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
1572 |
"Modified: / 27.8.1995 / 22:47:32 / claus" |
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
1573 |
"Modified: / 20.1.1997 / 12:36:08 / cg" |
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
1574 |
"Created: / 2.4.1997 / 17:30:33 / stefan" |
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
1575 |
"Modified: / 18.3.1999 / 18:16:58 / stefan" |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1576 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1577 |
|
6746
8bbd639df663
removeSelector change: remember methods previous version
Claus Gittinger <cg@exept.de>
parents:
6732
diff
changeset
|
1578 |
addChangeRecordForRemoveSelector:aSelector fromOld:oldMethod |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1579 |
"{ Pragma: +optSpace }" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1580 |
|
5553
1740d3ae50ff
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
5515
diff
changeset
|
1581 |
"add a method-remove-record to the changes file and to the current changeSet" |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1582 |
|
4056
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
1583 |
UpdateChangeFileQuerySignal query ifTrue:[ |
8551 | 1584 |
self writingChangePerform:#addChangeRecordForRemoveSelector:to: with:aSelector. |
6097 | 1585 |
]. |
1586 |
||
1587 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1588 |
Project notNil ifTrue:[ |
|
8551 | 1589 |
UpdateChangeListQuerySignal query ifTrue:[ |
1590 |
Project addRemoveSelectorChange:aSelector fromOld:oldMethod in:self |
|
1591 |
] |
|
6097 | 1592 |
]. |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1593 |
|
3288
373af30a15ca
add removeSelectorChange to current projects changeSet
Claus Gittinger <cg@exept.de>
parents:
3230
diff
changeset
|
1594 |
"Created: / 2.4.1997 / 17:30:47 / stefan" |
373af30a15ca
add removeSelectorChange to current projects changeSet
Claus Gittinger <cg@exept.de>
parents:
3230
diff
changeset
|
1595 |
"Modified: / 16.2.1998 / 12:45:45 / cg" |
4056
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
1596 |
"Modified: / 18.3.1999 / 18:17:02 / stefan" |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1597 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1598 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1599 |
addChangeRecordForRenameCategory:oldCategory to:newCategory |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1600 |
"{ Pragma: +optSpace }" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1601 |
|
5553
1740d3ae50ff
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
5515
diff
changeset
|
1602 |
"add a category-rename record to the changes file and to the current changeSet" |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1603 |
|
4056
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
1604 |
UpdateChangeFileQuerySignal query ifTrue:[ |
8551 | 1605 |
self writingChangeDo:[:aStream | |
1606 |
self addChangeRecordForRenameCategory:oldCategory to:newCategory to:aStream. |
|
1607 |
]. |
|
6097 | 1608 |
]. |
1609 |
||
1610 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1611 |
Project notNil ifTrue:[ |
|
8551 | 1612 |
UpdateChangeListQuerySignal query ifTrue:[ |
1613 |
Project addRenameCategoryChangeIn:self from:oldCategory to:newCategory |
|
1614 |
] |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1615 |
] |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1616 |
|
4056
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
1617 |
"Created: / 2.4.1997 / 17:31:03 / stefan" |
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
1618 |
"Modified: / 18.3.1999 / 18:17:08 / stefan" |
5237
ac92ad320972
changeSet entry for category rename
Claus Gittinger <cg@exept.de>
parents:
5216
diff
changeset
|
1619 |
"Modified: / 6.2.2000 / 02:26:58 / cg" |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1620 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1621 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1622 |
addChangeTimeStampTo:aStream |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1623 |
"{ Pragma: +optSpace }" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1624 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1625 |
"a timestamp - prepended to any change, except infoRecords" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1626 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1627 |
|info| |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1628 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1629 |
info := 'timestamp ' , OperatingSystem getLoginName , '@' , OperatingSystem getHostName. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1630 |
self addInfoRecord:info to:aStream. aStream cr. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1631 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1632 |
"Modified: 22.3.1997 / 17:14:10 / cg" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1633 |
"Created: 3.4.1997 / 19:18:27 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1634 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1635 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1636 |
addInfoRecord:aMessage |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1637 |
"{ Pragma: +optSpace }" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1638 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1639 |
"add an info-record (snapshot, class fileOut etc.) to the changes file" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1640 |
|
4056
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
1641 |
UpdateChangeFileQuerySignal query ifTrue:[ |
8551 | 1642 |
self writingChangeWithTimeStamp:false |
1643 |
perform:#addInfoRecord:to: |
|
1644 |
with:aMessage. |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1645 |
] |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1646 |
|
4056
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
1647 |
"Modified: / 24.1.1997 / 19:13:14 / cg" |
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
1648 |
"Created: / 2.4.1997 / 17:34:18 / stefan" |
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
1649 |
"Modified: / 18.3.1999 / 18:17:13 / stefan" |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1650 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1651 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1652 |
changesStream |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1653 |
"return a Stream for the writing changes file. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1654 |
This returns a regular stream or a locked stream - according to |
8551 | 1655 |
the LockChangesFile settings |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1656 |
(recommended if multiple images operate on a common changes file)" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1657 |
|
8551 | 1658 |
|streamType changesStream fileName |
18764 | 1659 |
encoding changeFileIsNew| |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1660 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1661 |
fileName := ObjectMemory nameForChanges. |
8551 | 1662 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1663 |
LockChangesFile ifTrue:[ |
8711
c5f28b4c719d
guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents:
8694
diff
changeset
|
1664 |
streamType := LockedFileStream. |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1665 |
] ifFalse:[ |
8711
c5f28b4c719d
guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents:
8694
diff
changeset
|
1666 |
streamType := FileStream. |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1667 |
]. |
7086
40eea91992ec
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
6930
diff
changeset
|
1668 |
|
40eea91992ec
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
6930
diff
changeset
|
1669 |
[ |
8711
c5f28b4c719d
guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents:
8694
diff
changeset
|
1670 |
changesStream := streamType fileNamed:fileName. |
25178 | 1671 |
] on:OpenError do:[:ex| |
25295 | 1672 |
self warn:(c'%2\n\nCannot create/update the changes file "%1"\nPlease check the path and/or permissions' |
16471 | 1673 |
bindWith:fileName with:ex description). |
8711
c5f28b4c719d
guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents:
8694
diff
changeset
|
1674 |
^ nil |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1675 |
]. |
14096 | 1676 |
|
24746 | 1677 |
changeFileIsNew := changesStream fileSize == 0. |
14096 | 1678 |
changeFileIsNew ifTrue:[ |
18764 | 1679 |
encoding := #utf8. |
14096 | 1680 |
] ifFalse:[ |
1681 |
encoding := CharacterEncoder guessEncodingOfStream:changesStream. |
|
1682 |
encoding isNil ifTrue:[ |
|
1683 |
encoding := #'iso8859-1'. |
|
1684 |
]. |
|
1685 |
]. |
|
8161 | 1686 |
changesStream setToEnd. |
1687 |
||
18764 | 1688 |
changesStream := EncodedStream stream:changesStream encoding:encoding. |
8161 | 1689 |
changeFileIsNew ifTrue:[ |
18764 | 1690 |
changesStream nextPutLine:'"{ Encoding: ' , encoding , ' }" !!'. |
8161 | 1691 |
]. |
1692 |
||
1693 |
^ changesStream |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1694 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1695 |
"Modified: 24.1.1997 / 19:14:27 / cg" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1696 |
"Created: 2.4.1997 / 17:34:13 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1697 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1698 |
|
9518 | 1699 |
withoutUpdatingChangeSetDo:aBlock |
1700 |
"turn off changeSet update while evaluating aBlock. |
|
12082 | 1701 |
Returns the block's evaluated value." |
9518 | 1702 |
|
1703 |
|retVal| |
|
1704 |
||
1705 |
(UpdateChangeListQuerySignal) answer:false |
|
1706 |
do:[ |
|
1707 |
retVal := aBlock value |
|
1708 |
]. |
|
1709 |
^ retVal |
|
1710 |
||
1711 |
"Created: / 10-08-2006 / 19:15:45 / cg" |
|
1712 |
! |
|
1713 |
||
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1714 |
withoutUpdatingChangesDo:aBlock |
6545 | 1715 |
"turn off change file update while evaluating aBlock. |
12082 | 1716 |
Returns the block's evaluated value." |
6545 | 1717 |
|
1718 |
|retVal| |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1719 |
|
8694
64a59d1b803c
Use SignalSets instead of nested handlers.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
1720 |
(UpdateChangeFileQuerySignal, UpdateChangeListQuerySignal) answer:false |
6097 | 1721 |
do:[ |
8694
64a59d1b803c
Use SignalSets instead of nested handlers.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
1722 |
retVal := aBlock value |
6545 | 1723 |
]. |
1724 |
^ retVal |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1725 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1726 |
"Modified: 17.1.1997 / 20:48:05 / cg" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1727 |
"Created: 2.4.1997 / 17:34:35 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1728 |
! ! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1729 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1730 |
!ClassDescription methodsFor:'compiling'! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1731 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1732 |
compile:code classified:category |
8551 | 1733 |
"compile code, aString for this class; |
1734 |
if successful update the method dictionary. |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1735 |
The method is classified under category. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1736 |
Returns the new method or nil (on failure)." |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1737 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1738 |
^ self compile:code classified:category logged:true |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1739 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1740 |
"Modified: 20.4.1996 / 12:30:51 / cg" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1741 |
"Created: 1.4.1997 / 23:43:57 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1742 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1743 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1744 |
compile:code classified:category logged:logged |
8551 | 1745 |
"compile code, aString for this class; |
1746 |
if successful update the method dictionary. |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1747 |
The method is classified under category. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1748 |
If logged is true, a changeRecord is written. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1749 |
Returns the new method or nil (on failure)." |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1750 |
|
6623 | 1751 |
|compiler| |
1752 |
||
8428 | 1753 |
compiler := self compilerClass. |
6623 | 1754 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1755 |
logged ifFalse:[ |
8551 | 1756 |
self withoutUpdatingChangesDo:[ |
1757 |
^ compiler |
|
1758 |
compile:code |
|
1759 |
forClass:self |
|
1760 |
inCategory:category |
|
1761 |
] |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1762 |
] ifTrue:[ |
8551 | 1763 |
^ compiler |
1764 |
compile:code |
|
1765 |
forClass:self |
|
1766 |
inCategory:category |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1767 |
]. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1768 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1769 |
"Modified: 13.12.1995 / 11:02:34 / cg" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1770 |
"Created: 1.4.1997 / 23:44:02 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1771 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1772 |
|
3606
397b95da25e9
added #compile:calssified:notifying: (ST-80)
Claus Gittinger <cg@exept.de>
parents:
3603
diff
changeset
|
1773 |
compile:code classified:cat notifying:requestor |
397b95da25e9
added #compile:calssified:notifying: (ST-80)
Claus Gittinger <cg@exept.de>
parents:
3603
diff
changeset
|
1774 |
"compile code, aString for this class; on any error, notify |
397b95da25e9
added #compile:calssified:notifying: (ST-80)
Claus Gittinger <cg@exept.de>
parents:
3603
diff
changeset
|
1775 |
requestor, anObject with the error reason. |
397b95da25e9
added #compile:calssified:notifying: (ST-80)
Claus Gittinger <cg@exept.de>
parents:
3603
diff
changeset
|
1776 |
Install the method under the category, cat. |
397b95da25e9
added #compile:calssified:notifying: (ST-80)
Claus Gittinger <cg@exept.de>
parents:
3603
diff
changeset
|
1777 |
Returns the new method or nil (on failure)." |
397b95da25e9
added #compile:calssified:notifying: (ST-80)
Claus Gittinger <cg@exept.de>
parents:
3603
diff
changeset
|
1778 |
|
8551 | 1779 |
^ self compilerClass |
1780 |
compile:code |
|
1781 |
forClass:self |
|
1782 |
inCategory:cat |
|
1783 |
notifying:requestor |
|
3606
397b95da25e9
added #compile:calssified:notifying: (ST-80)
Claus Gittinger <cg@exept.de>
parents:
3603
diff
changeset
|
1784 |
|
397b95da25e9
added #compile:calssified:notifying: (ST-80)
Claus Gittinger <cg@exept.de>
parents:
3603
diff
changeset
|
1785 |
"Modified: / 13.12.1995 / 11:02:40 / cg" |
397b95da25e9
added #compile:calssified:notifying: (ST-80)
Claus Gittinger <cg@exept.de>
parents:
3603
diff
changeset
|
1786 |
"Created: / 18.6.1998 / 15:52:15 / cg" |
397b95da25e9
added #compile:calssified:notifying: (ST-80)
Claus Gittinger <cg@exept.de>
parents:
3603
diff
changeset
|
1787 |
! |
397b95da25e9
added #compile:calssified:notifying: (ST-80)
Claus Gittinger <cg@exept.de>
parents:
3603
diff
changeset
|
1788 |
|
3097
5d06fb326f0b
added #compile:notifying:ifFail: (ST80 compat)
Claus Gittinger <cg@exept.de>
parents:
3074
diff
changeset
|
1789 |
compile:code notifying:requestor ifFail:failBlock |
5d06fb326f0b
added #compile:notifying:ifFail: (ST80 compat)
Claus Gittinger <cg@exept.de>
parents:
3074
diff
changeset
|
1790 |
"compile code, aString for this class; on any error, notify |
5d06fb326f0b
added #compile:notifying:ifFail: (ST80 compat)
Claus Gittinger <cg@exept.de>
parents:
3074
diff
changeset
|
1791 |
requestor, anObject with the error reason. |
5d06fb326f0b
added #compile:notifying:ifFail: (ST80 compat)
Claus Gittinger <cg@exept.de>
parents:
3074
diff
changeset
|
1792 |
Returns the new method or nil (on failure)." |
5d06fb326f0b
added #compile:notifying:ifFail: (ST80 compat)
Claus Gittinger <cg@exept.de>
parents:
3074
diff
changeset
|
1793 |
|
5d06fb326f0b
added #compile:notifying:ifFail: (ST80 compat)
Claus Gittinger <cg@exept.de>
parents:
3074
diff
changeset
|
1794 |
|rslt| |
5d06fb326f0b
added #compile:notifying:ifFail: (ST80 compat)
Claus Gittinger <cg@exept.de>
parents:
3074
diff
changeset
|
1795 |
|
8551 | 1796 |
rslt := self compilerClass |
1797 |
compile:code |
|
1798 |
forClass:self |
|
1799 |
notifying:requestor. |
|
6623 | 1800 |
|
3097
5d06fb326f0b
added #compile:notifying:ifFail: (ST80 compat)
Claus Gittinger <cg@exept.de>
parents:
3074
diff
changeset
|
1801 |
(rslt isNil or:[rslt == #Error]) ifTrue:[ |
8551 | 1802 |
^ failBlock value |
3097
5d06fb326f0b
added #compile:notifying:ifFail: (ST80 compat)
Claus Gittinger <cg@exept.de>
parents:
3074
diff
changeset
|
1803 |
]. |
5d06fb326f0b
added #compile:notifying:ifFail: (ST80 compat)
Claus Gittinger <cg@exept.de>
parents:
3074
diff
changeset
|
1804 |
^ rslt |
5d06fb326f0b
added #compile:notifying:ifFail: (ST80 compat)
Claus Gittinger <cg@exept.de>
parents:
3074
diff
changeset
|
1805 |
|
5d06fb326f0b
added #compile:notifying:ifFail: (ST80 compat)
Claus Gittinger <cg@exept.de>
parents:
3074
diff
changeset
|
1806 |
"Modified: / 13.12.1995 / 11:02:40 / cg" |
5d06fb326f0b
added #compile:notifying:ifFail: (ST80 compat)
Claus Gittinger <cg@exept.de>
parents:
3074
diff
changeset
|
1807 |
"Created: / 8.11.1997 / 13:42:02 / cg" |
5d06fb326f0b
added #compile:notifying:ifFail: (ST80 compat)
Claus Gittinger <cg@exept.de>
parents:
3074
diff
changeset
|
1808 |
! |
5d06fb326f0b
added #compile:notifying:ifFail: (ST80 compat)
Claus Gittinger <cg@exept.de>
parents:
3074
diff
changeset
|
1809 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1810 |
recompile |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1811 |
"{ Pragma: +optSpace }" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1812 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1813 |
"recompile all methods |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1814 |
used when a class changes instances and therefore all methods |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1815 |
have to be recompiled" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1816 |
|
9308 | 1817 |
self recompileUsingCompilerClass:(self compilerClass) |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1818 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1819 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1820 |
recompile:aSelector |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1821 |
"{ Pragma: +optSpace }" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1822 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1823 |
"recompile the method associated with the argument, aSelector; |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1824 |
used when a superclass changes instances and we have to recompile |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1825 |
subclasses" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1826 |
|
13761
4e57a29115f3
added: #recompile:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
13677
diff
changeset
|
1827 |
^ self recompile:aSelector usingCompilerClass:(self compilerClass) |
4e57a29115f3
added: #recompile:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
13677
diff
changeset
|
1828 |
|
4e57a29115f3
added: #recompile:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
13677
diff
changeset
|
1829 |
"Modified (format): / 30-09-2011 / 12:50:13 / cg" |
9308 | 1830 |
! |
1831 |
||
13761
4e57a29115f3
added: #recompile:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
13677
diff
changeset
|
1832 |
recompile:aSelector usingCompiler:aCompiler |
9308 | 1833 |
"{ Pragma: +optSpace }" |
1834 |
||
1835 |
"recompile the method associated with the argument, aSelector; |
|
1836 |
used when a superclass changes instances and we have to recompile |
|
1837 |
subclasses" |
|
1838 |
||
9690 | 1839 |
|cat code oldMethod oldPackage newMethod| |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1840 |
|
14511 | 1841 |
oldMethod := self compiledMethodAt:aSelector. |
1842 |
oldMethod isNil ifTrue:[ |
|
1843 |
self error:'no such method' |
|
1844 |
]. |
|
15707 | 1845 |
|
14511 | 1846 |
oldPackage := oldMethod getPackage. |
1847 |
cat := oldMethod category. |
|
1848 |
code := self sourceCodeAt:aSelector. |
|
1849 |
||
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1850 |
Class withoutUpdatingChangesDo:[ |
8837
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1851 |
|
13658
c0f327039da5
changed: #recompile:usingCompilerClass:
Claus Gittinger <cg@exept.de>
parents:
13627
diff
changeset
|
1852 |
Error handle:[:ex | |
15707 | 1853 |
"/ don't want to loose code !! |
13658
c0f327039da5
changed: #recompile:usingCompilerClass:
Claus Gittinger <cg@exept.de>
parents:
13627
diff
changeset
|
1854 |
Transcript showCR:ex description. |
24746 | 1855 |
newMethod := oldMethod class trapMethodForNumArgs:(oldMethod argumentCount). |
13658
c0f327039da5
changed: #recompile:usingCompilerClass:
Claus Gittinger <cg@exept.de>
parents:
13627
diff
changeset
|
1856 |
newMethod source:code. |
c0f327039da5
changed: #recompile:usingCompilerClass:
Claus Gittinger <cg@exept.de>
parents:
13627
diff
changeset
|
1857 |
] do:[ |
25000 | 1858 |
UndefinedVariableError handle:[:ex | |
1859 |
ex proceed |
|
1860 |
] do:[ |
|
1861 |
Class methodRedefinitionNotification answer:#keep do:[ |
|
1862 |
"/ hack - compilers have different protocols... (needs fix) |
|
1863 |
(aCompiler respondsTo:#compile:forClass:inCategory:) |
|
1864 |
ifTrue:[ |
|
1865 |
"/ ST/X's compiler |
|
1866 |
aCompiler compile:code forClass:self inCategory:cat |
|
1867 |
] ifFalse:[ |
|
1868 |
"/ some other (TGEN) compiler |
|
1869 |
aCompiler |
|
1870 |
compile:code |
|
1871 |
in:self |
|
1872 |
notifying:nil |
|
1873 |
ifFail:[]. |
|
1874 |
]. |
|
13658
c0f327039da5
changed: #recompile:usingCompilerClass:
Claus Gittinger <cg@exept.de>
parents:
13627
diff
changeset
|
1875 |
]. |
8837
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1876 |
]. |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1877 |
]. |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1878 |
newMethod := self compiledMethodAt:aSelector. |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1879 |
newMethod setPackage:oldPackage. |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1880 |
] |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1881 |
|
13658
c0f327039da5
changed: #recompile:usingCompilerClass:
Claus Gittinger <cg@exept.de>
parents:
13627
diff
changeset
|
1882 |
"Created: / 01-04-1997 / 23:43:34 / stefan" |
c0f327039da5
changed: #recompile:usingCompilerClass:
Claus Gittinger <cg@exept.de>
parents:
13627
diff
changeset
|
1883 |
"Modified: / 04-03-1998 / 13:01:55 / stefan" |
c0f327039da5
changed: #recompile:usingCompilerClass:
Claus Gittinger <cg@exept.de>
parents:
13627
diff
changeset
|
1884 |
"Modified: / 08-09-2011 / 05:37:12 / cg" |
13761
4e57a29115f3
added: #recompile:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
13677
diff
changeset
|
1885 |
"Created: / 30-09-2011 / 12:45:58 / cg" |
4e57a29115f3
added: #recompile:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
13677
diff
changeset
|
1886 |
! |
4e57a29115f3
added: #recompile:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
13677
diff
changeset
|
1887 |
|
4e57a29115f3
added: #recompile:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
13677
diff
changeset
|
1888 |
recompile:aSelector usingCompilerClass:aCompilerClass |
4e57a29115f3
added: #recompile:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
13677
diff
changeset
|
1889 |
"{ Pragma: +optSpace }" |
4e57a29115f3
added: #recompile:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
13677
diff
changeset
|
1890 |
|
4e57a29115f3
added: #recompile:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
13677
diff
changeset
|
1891 |
"recompile the method associated with the argument, aSelector; |
4e57a29115f3
added: #recompile:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
13677
diff
changeset
|
1892 |
used when a superclass changes instances and we have to recompile |
4e57a29115f3
added: #recompile:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
13677
diff
changeset
|
1893 |
subclasses" |
4e57a29115f3
added: #recompile:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
13677
diff
changeset
|
1894 |
|
4e57a29115f3
added: #recompile:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
13677
diff
changeset
|
1895 |
^ self recompile:aSelector usingCompiler:aCompilerClass new |
4e57a29115f3
added: #recompile:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
13677
diff
changeset
|
1896 |
|
4e57a29115f3
added: #recompile:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
13677
diff
changeset
|
1897 |
"Created: / 01-04-1997 / 23:43:34 / stefan" |
4e57a29115f3
added: #recompile:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
13677
diff
changeset
|
1898 |
"Modified: / 04-03-1998 / 13:01:55 / stefan" |
4e57a29115f3
added: #recompile:usingCompiler:
Claus Gittinger <cg@exept.de>
parents:
13677
diff
changeset
|
1899 |
"Modified: / 30-09-2011 / 12:46:19 / cg" |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1900 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1901 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1902 |
recompileAll |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1903 |
"{ Pragma: +optSpace }" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1904 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1905 |
"recompile this class and all subclasses" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1906 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1907 |
|classes| |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1908 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1909 |
classes := self subclasses. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1910 |
self recompile. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1911 |
classes do:[:aClass | |
3918
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
1912 |
aClass recompileAll |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1913 |
] |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1914 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1915 |
"Modified: 5.1.1997 / 19:56:29 / cg" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1916 |
"Created: 1.4.1997 / 23:44:15 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1917 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1918 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1919 |
recompileForSpeed:aSelector |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1920 |
"{ Pragma: +optSpace }" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1921 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1922 |
"recompile the method associated with the argument, aSelector; |
9690 | 1923 |
for highest speed (i.e. using the stc compiler, if supported by the architecture)." |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1924 |
|
9097 | 1925 |
|cat code oldMethod oldPackage newMethod| |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1926 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1927 |
Class withoutUpdatingChangesDo:[ |
8837
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1928 |
oldMethod := self compiledMethodAt:aSelector. |
9690 | 1929 |
oldPackage := oldMethod getPackage. |
8837
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1930 |
cat := oldMethod category. |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1931 |
code := self sourceCodeAt:aSelector. |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1932 |
|
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1933 |
Class methodRedefinitionNotification answer:#keep do:[ |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1934 |
[ |
9097 | 1935 |
ParserFlags |
1936 |
withSTCCompilation:#always |
|
1937 |
do:[ |
|
1938 |
self compilerClass compile:code forClass:self inCategory:cat |
|
1939 |
]. |
|
8837
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1940 |
] ensure:[ |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1941 |
(self compiledMethodAt:aSelector) isNil ifTrue:[ |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1942 |
self primAddSelector:aSelector withMethod:oldMethod |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1943 |
] |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1944 |
] |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1945 |
]. |
d8be7c9b7ca5
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8745
diff
changeset
|
1946 |
newMethod := self compiledMethodAt:aSelector. |
9690 | 1947 |
newMethod setPackage:oldPackage. |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1948 |
] |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1949 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1950 |
"Modified: 5.1.1997 / 19:55:33 / cg" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1951 |
"Created: 1.4.1997 / 23:44:32 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1952 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1953 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1954 |
recompileInvalidatedMethods |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1955 |
"{ Pragma: +optSpace }" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1956 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1957 |
"recompile all invalidated methods" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1958 |
|
5369 | 1959 |
self selectorsAndMethodsDo:[:aSelector :aMethod | |
24746 | 1960 |
|trap trapCode trapByteCode| |
1961 |
||
1962 |
trap := aMethod trapMethodForNumArgs:aMethod argumentCount. |
|
1963 |
trapCode := trap code. |
|
1964 |
trapByteCode := trap byteCode. |
|
1965 |
||
1966 |
(aMethod code = trapCode |
|
1967 |
or:[aMethod byteCode == trapByteCode]) ifTrue:[ |
|
1968 |
self recompile:aSelector |
|
1969 |
] |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1970 |
] |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1971 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1972 |
"Modified: 12.6.1996 / 11:52:09 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1973 |
"Modified: 5.1.1997 / 19:56:59 / cg" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1974 |
"Created: 1.4.1997 / 23:44:37 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1975 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1976 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1977 |
recompileMethodsAccessingAny:setOfNames |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1978 |
"{ Pragma: +optSpace }" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1979 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1980 |
"recompile all methods accessing a variable from setOfNames" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1981 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1982 |
self recompileMethodsAccessingAny:setOfNames orSuper:false |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1983 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1984 |
"Modified: 5.1.1997 / 19:57:05 / cg" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1985 |
"Created: 1.4.1997 / 23:44:41 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1986 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1987 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1988 |
recompileMethodsAccessingAny:setOfNames orSuper:superBoolean |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1989 |
"{ Pragma: +optSpace }" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1990 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1991 |
"recompile all methods accessing a variable from setOfNames, |
15447 | 1992 |
or super (if superBoolean is true). |
1993 |
Also recompiles methods with possibly inlined instVarIndexFor:" |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1994 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1995 |
|p| |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
1996 |
|
5369 | 1997 |
self selectorsAndMethodsDo:[:aSelector :aMethod | |
11988 | 1998 |
|mustCompile lits source| |
1999 |
||
2000 |
mustCompile := nil. |
|
2001 |
||
2002 |
source := aMethod source. |
|
14617 | 2003 |
source isNil ifTrue:[ |
14618 | 2004 |
self error:('Cannot recompile, source is missing for ', aMethod displayString). |
14617 | 2005 |
]. |
11988 | 2006 |
|
2007 |
"/ avoid parsing, if possible |
|
2008 |
superBoolean ifFalse:[ |
|
2009 |
setOfNames size == 1 ifTrue:[ |
|
2010 |
(source findString:(setOfNames first)) == 0 ifTrue:[ |
|
2011 |
mustCompile := false. |
|
2012 |
] |
|
2013 |
] |
|
2014 |
]. |
|
2015 |
||
2016 |
mustCompile isNil ifTrue:[ |
|
2017 |
p := self parserClass parseMethod:source in:self. |
|
2018 |
(p isNil |
|
21342 | 2019 |
or:[(aMethod sendsAnySelector:#( instVarIndexFor: instVarOffsetOf: )) |
11988 | 2020 |
or:[(p usedVars includesAny:setOfNames) |
15447 | 2021 |
or:[superBoolean and:[p usesSuper]]]]) ifTrue:[ |
11988 | 2022 |
mustCompile := true |
2023 |
] |
|
2024 |
]. |
|
2025 |
||
2026 |
mustCompile == true ifTrue:[ |
|
2027 |
self recompile:aSelector |
|
2028 |
] |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2029 |
] |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2030 |
|
11988 | 2031 |
"Created: / 01-04-1997 / 23:44:46 / stefan" |
2032 |
"Modified: / 21-08-2009 / 12:19:09 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
21342 | 2033 |
"Modified: / 05-02-2017 / 01:27:36 / cg" |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2034 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2035 |
|
3219
33b5d79b32ff
New method #recompileMethodsAccessingAnyClassvarOrGlobal:
Stefan Vogel <sv@exept.de>
parents:
3097
diff
changeset
|
2036 |
recompileMethodsAccessingAnyClassvarOrGlobal:aCollection |
33b5d79b32ff
New method #recompileMethodsAccessingAnyClassvarOrGlobal:
Stefan Vogel <sv@exept.de>
parents:
3097
diff
changeset
|
2037 |
"{ Pragma: +optSpace }" |
33b5d79b32ff
New method #recompileMethodsAccessingAnyClassvarOrGlobal:
Stefan Vogel <sv@exept.de>
parents:
3097
diff
changeset
|
2038 |
|
33b5d79b32ff
New method #recompileMethodsAccessingAnyClassvarOrGlobal:
Stefan Vogel <sv@exept.de>
parents:
3097
diff
changeset
|
2039 |
"recompile all methods accessing a global or classvar in aCollection" |
33b5d79b32ff
New method #recompileMethodsAccessingAnyClassvarOrGlobal:
Stefan Vogel <sv@exept.de>
parents:
3097
diff
changeset
|
2040 |
|
4110 | 2041 |
"/ Transcript showCR:self name , ' recompiling accesses to ' , aCollection printString. |
2042 |
||
5369 | 2043 |
self selectorsAndMethodsDo:[:aSelector :aMethod | |
8551 | 2044 |
(aMethod literalsDetect:[ :lit | |i l| |
2045 |
"classVars are named 'className:varName' in |
|
2046 |
the literal array" |
|
2047 |
||
2048 |
lit isSymbol and:[ |
|
2049 |
i := lit lastIndexOf:$:. |
|
2050 |
i == 0 ifTrue:[ |
|
2051 |
l := lit. |
|
2052 |
] ifFalse:[ |
|
2053 |
l := lit copyFrom:(i + 1). |
|
2054 |
]. |
|
2055 |
aCollection includes:l |
|
2056 |
]. |
|
2057 |
] ifNone:[]) notNil ifTrue:[ |
|
4110 | 2058 |
"/ Transcript showCR:self name , ' recompiling ' , aSelector. |
8551 | 2059 |
self recompile:aSelector |
2060 |
] |
|
3219
33b5d79b32ff
New method #recompileMethodsAccessingAnyClassvarOrGlobal:
Stefan Vogel <sv@exept.de>
parents:
3097
diff
changeset
|
2061 |
] |
33b5d79b32ff
New method #recompileMethodsAccessingAnyClassvarOrGlobal:
Stefan Vogel <sv@exept.de>
parents:
3097
diff
changeset
|
2062 |
|
33b5d79b32ff
New method #recompileMethodsAccessingAnyClassvarOrGlobal:
Stefan Vogel <sv@exept.de>
parents:
3097
diff
changeset
|
2063 |
"Modified: / 29.8.1997 / 07:59:24 / cg" |
33b5d79b32ff
New method #recompileMethodsAccessingAnyClassvarOrGlobal:
Stefan Vogel <sv@exept.de>
parents:
3097
diff
changeset
|
2064 |
"Created: / 23.1.1998 / 12:13:32 / stefan" |
33b5d79b32ff
New method #recompileMethodsAccessingAnyClassvarOrGlobal:
Stefan Vogel <sv@exept.de>
parents:
3097
diff
changeset
|
2065 |
"Modified: / 23.1.1998 / 16:13:45 / stefan" |
33b5d79b32ff
New method #recompileMethodsAccessingAnyClassvarOrGlobal:
Stefan Vogel <sv@exept.de>
parents:
3097
diff
changeset
|
2066 |
! |
33b5d79b32ff
New method #recompileMethodsAccessingAnyClassvarOrGlobal:
Stefan Vogel <sv@exept.de>
parents:
3097
diff
changeset
|
2067 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2068 |
recompileMethodsAccessingGlobal:aGlobalKey |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2069 |
"{ Pragma: +optSpace }" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2070 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2071 |
"recompile all methods accessing the global variable aGlobalKey" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2072 |
|
8745 | 2073 |
"/ Transcript |
2074 |
"/ show:self name; |
|
2075 |
"/ show:'recompiling for: '; |
|
2076 |
"/ show:aGlobalKey; |
|
2077 |
"/ showCR:'...'. |
|
2078 |
||
5369 | 2079 |
self selectorsAndMethodsDo:[:aSelector :aMethod | |
8745 | 2080 |
(aMethod literalsDetect:[:lit| lit = aGlobalKey] ifNone:[]) notNil ifTrue:[ |
2081 |
"/ Transcript |
|
2082 |
"/ show:' ->'; |
|
2083 |
"/ showCR:aSelector. |
|
2084 |
||
2085 |
self recompile:aSelector. |
|
2086 |
]. |
|
3219
33b5d79b32ff
New method #recompileMethodsAccessingAnyClassvarOrGlobal:
Stefan Vogel <sv@exept.de>
parents:
3097
diff
changeset
|
2087 |
]. |
33b5d79b32ff
New method #recompileMethodsAccessingAnyClassvarOrGlobal:
Stefan Vogel <sv@exept.de>
parents:
3097
diff
changeset
|
2088 |
|
33b5d79b32ff
New method #recompileMethodsAccessingAnyClassvarOrGlobal:
Stefan Vogel <sv@exept.de>
parents:
3097
diff
changeset
|
2089 |
"Created: / 1.4.1997 / 23:44:53 / stefan" |
33b5d79b32ff
New method #recompileMethodsAccessingAnyClassvarOrGlobal:
Stefan Vogel <sv@exept.de>
parents:
3097
diff
changeset
|
2090 |
"Modified: / 29.8.1997 / 07:59:24 / cg" |
33b5d79b32ff
New method #recompileMethodsAccessingAnyClassvarOrGlobal:
Stefan Vogel <sv@exept.de>
parents:
3097
diff
changeset
|
2091 |
"Modified: / 23.1.1998 / 15:47:55 / stefan" |
4750
85d942724808
support recompile of all machine code methods
Claus Gittinger <cg@exept.de>
parents:
4733
diff
changeset
|
2092 |
! |
85d942724808
support recompile of all machine code methods
Claus Gittinger <cg@exept.de>
parents:
4733
diff
changeset
|
2093 |
|
85d942724808
support recompile of all machine code methods
Claus Gittinger <cg@exept.de>
parents:
4733
diff
changeset
|
2094 |
recompileMethodsWithMachineCode |
85d942724808
support recompile of all machine code methods
Claus Gittinger <cg@exept.de>
parents:
4733
diff
changeset
|
2095 |
"{ Pragma: +optSpace }" |
85d942724808
support recompile of all machine code methods
Claus Gittinger <cg@exept.de>
parents:
4733
diff
changeset
|
2096 |
|
8551 | 2097 |
"recompile all methods which have non-dynamic machineCode |
15447 | 2098 |
(i.e. those, which were loaded from a compiled classLibrary)" |
4750
85d942724808
support recompile of all machine code methods
Claus Gittinger <cg@exept.de>
parents:
4733
diff
changeset
|
2099 |
|
5369 | 2100 |
self selectorsAndMethodsDo:[:aSelector :oldMethod | |
15447 | 2101 |
|newMethod| |
2102 |
||
2103 |
oldMethod isLazyMethod ifFalse:[ |
|
2104 |
oldMethod byteCode isNil ifTrue:[ |
|
2105 |
self recompile:aSelector. |
|
2106 |
newMethod := self compiledMethodAt:aSelector. |
|
2107 |
oldMethod ~~ newMethod ifTrue:[ |
|
2108 |
newMethod sourceFilename:(oldMethod getSource) position:(oldMethod getSourcePosition) |
|
2109 |
] |
|
2110 |
]. |
|
2111 |
]. |
|
4750
85d942724808
support recompile of all machine code methods
Claus Gittinger <cg@exept.de>
parents:
4733
diff
changeset
|
2112 |
]. |
9308 | 2113 |
! |
2114 |
||
2115 |
recompileUsingCompilerClass:aCompilerClass |
|
2116 |
"{ Pragma: +optSpace }" |
|
2117 |
||
2118 |
"recompile all methods |
|
2119 |
used when a class changes instances and therefore all methods |
|
2120 |
have to be recompiled" |
|
2121 |
||
2122 |
self selectorsAndMethodsDo:[:aSelector :aMethod | |
|
2123 |
self recompile:aSelector usingCompilerClass:aCompilerClass |
|
2124 |
] |
|
2125 |
||
2126 |
"Modified: 12.6.1996 / 11:51:15 / stefan" |
|
2127 |
"Created: 1.4.1997 / 23:43:38 / stefan" |
|
2128 |
"Modified: 29.8.1997 / 07:56:49 / cg" |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2129 |
! ! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2130 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2131 |
!ClassDescription methodsFor:'fileIn interface'! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2132 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2133 |
ignoredMethodsFor:aCategory |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2134 |
"this is a speciality of ST/X - it allows quick commenting of methods |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2135 |
from a source-file by replacing the 'methodsFor:' by 'ignoredMethodsFor:'. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2136 |
Returns a ClassCategoryReader to read in and skip methods." |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2137 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2138 |
^ (self methodsFor:aCategory) ignoredProtocol |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2139 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2140 |
"Modified: 10.2.1996 / 12:53:25 / cg" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2141 |
"Created: 1.4.1997 / 13:58:46 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2142 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2143 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2144 |
methods |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2145 |
"this method allows fileIn of ST/V methods - |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2146 |
return a ClassCategoryReader to read in and compile methods for me. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2147 |
Since ST/V does not support method categories, the loaded methods are |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2148 |
categorized as 'ST/V methods'." |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2149 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2150 |
^ ClassCategoryReader class:self category:'ST/V methods' |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2151 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2152 |
"Modified: 10.2.1996 / 12:44:21 / cg" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2153 |
"Created: 1.4.1997 / 13:58:52 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2154 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2155 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2156 |
methodsFor:aCategory |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2157 |
"return a ClassCategoryReader to read in and compile methods for me." |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2158 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2159 |
^ ClassCategoryReader class:self category:aCategory |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2160 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2161 |
"Modified: 10.2.1996 / 12:44:43 / cg" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2162 |
"Created: 1.4.1997 / 13:57:37 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2163 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2164 |
|
3035
8c574753e6d4
allow squeak code to be filedIn (methodsFor:stamp:)
Claus Gittinger <cg@exept.de>
parents:
2918
diff
changeset
|
2165 |
methodsFor:aCategory stamp:time |
8c574753e6d4
allow squeak code to be filedIn (methodsFor:stamp:)
Claus Gittinger <cg@exept.de>
parents:
2918
diff
changeset
|
2166 |
"return a ClassCategoryReader to read in and compile methods for me. |
8c574753e6d4
allow squeak code to be filedIn (methodsFor:stamp:)
Claus Gittinger <cg@exept.de>
parents:
2918
diff
changeset
|
2167 |
This was added to allow squeak code to be filedIn." |
8c574753e6d4
allow squeak code to be filedIn (methodsFor:stamp:)
Claus Gittinger <cg@exept.de>
parents:
2918
diff
changeset
|
2168 |
|
8c574753e6d4
allow squeak code to be filedIn (methodsFor:stamp:)
Claus Gittinger <cg@exept.de>
parents:
2918
diff
changeset
|
2169 |
^ self methodsFor:aCategory |
8c574753e6d4
allow squeak code to be filedIn (methodsFor:stamp:)
Claus Gittinger <cg@exept.de>
parents:
2918
diff
changeset
|
2170 |
|
8c574753e6d4
allow squeak code to be filedIn (methodsFor:stamp:)
Claus Gittinger <cg@exept.de>
parents:
2918
diff
changeset
|
2171 |
"Modified: 15.10.1997 / 18:51:53 / cg" |
8c574753e6d4
allow squeak code to be filedIn (methodsFor:stamp:)
Claus Gittinger <cg@exept.de>
parents:
2918
diff
changeset
|
2172 |
! |
8c574753e6d4
allow squeak code to be filedIn (methodsFor:stamp:)
Claus Gittinger <cg@exept.de>
parents:
2918
diff
changeset
|
2173 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2174 |
methodsForUndefined:categoryString |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2175 |
"ST-80 compatibility. |
20782 | 2176 |
I don't yet know what this does - it was encountered by some tester. |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2177 |
For now, simply forward it." |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2178 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2179 |
^ self methodsFor:categoryString |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2180 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2181 |
"Created: 1.4.1997 / 13:59:14 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2182 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2183 |
|
3583 | 2184 |
privateMethods |
2185 |
"this method allows fileIn of V'Age methods |
|
8551 | 2186 |
The privateMethods keyword is for documentation only; |
3583 | 2187 |
by default, methods are public (for backward compatibility) |
2188 |
(although, they could be made private here)." |
|
2189 |
||
2190 |
"/ uncomment to install as real private methods ... |
|
2191 |
"/ ^ (self methodsFor:'private') privateProtocol |
|
2192 |
||
2193 |
^ self methodsFor:'private' |
|
2194 |
||
2195 |
"Created: / 15.6.1998 / 20:29:29 / cg" |
|
2196 |
"Modified: / 15.6.1998 / 20:30:38 / cg" |
|
2197 |
! |
|
2198 |
||
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2199 |
privateMethodsFor:aCategory |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2200 |
"this method allows fileIn of ENVY and ST/X private methods. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2201 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2202 |
The following methods are only allowed to be executed if sent from a method |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2203 |
within the current class. Subclass sends or out-of-class sends will raise |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2204 |
a privatMethodError exception." |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2205 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2206 |
^ (self methodsFor:aCategory) privateProtocol |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2207 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2208 |
"Modified: 10.2.1996 / 12:48:44 / cg" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2209 |
"Created: 1.4.1997 / 14:01:07 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2210 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2211 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2212 |
protectedMethodsFor:aCategory |
8551 | 2213 |
"this method allows fileIn of ENVY and ST/X protected methods. |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2214 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2215 |
The following methods are only allowed to be executed if sent from a method |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2216 |
within the current class or a subclass. Out-of-class sends will raise |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2217 |
a privatMethodError exception." |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2218 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2219 |
^ (self methodsFor:aCategory) protectedProtocol |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2220 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2221 |
"Modified: 10.2.1996 / 12:49:18 / cg" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2222 |
"Created: 1.4.1997 / 13:59:32 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2223 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2224 |
|
3583 | 2225 |
publicMethods |
2226 |
"this method allows fileIn of V'Age methods |
|
8551 | 2227 |
The publicMethods keyword is for documentation only; |
3583 | 2228 |
by default, methods are public anyway (for backward compatibility)." |
2229 |
||
2230 |
^ self methodsFor:'public' |
|
2231 |
||
2232 |
"Created: / 1.4.1997 / 13:59:39 / stefan" |
|
2233 |
"Modified: / 15.6.1998 / 20:29:02 / cg" |
|
2234 |
! |
|
2235 |
||
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2236 |
publicMethodsFor:aCategory |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2237 |
"this method allows fileIn of ENVY methods |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2238 |
The publicMethods keyword is for documentation only; my default, methods |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2239 |
are public anyway (for backward compatibility)." |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2240 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2241 |
^ self methodsFor:aCategory |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2242 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2243 |
"Modified: 10.2.1996 / 12:50:11 / cg" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2244 |
"Created: 1.4.1997 / 13:59:39 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2245 |
! ! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2246 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2247 |
!ClassDescription methodsFor:'fileOut'! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2248 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2249 |
fileOutCategory:aCategory |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2250 |
"create a file 'class-category.st' consisting of all methods in aCategory. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2251 |
If the current project is not nil, create the file in the projects |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2252 |
directory." |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2253 |
|
11700 | 2254 |
"/ WARNING: will be obsoleted by SmalltalkChunkFileSourceWriter |
2255 |
||
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2256 |
|aStream fileName| |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2257 |
|
3050
d08734c8be27
use Filename protocol when generating fileNames;
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
2258 |
fileName := (self name , '-' , aCategory , '.st') asFilename. |
d08734c8be27
use Filename protocol when generating fileNames;
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
2259 |
fileName makeLegalFilename. |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2260 |
|
5192
9f0f4d7eaa33
must use full class name (ie. with namespace prefix)
Claus Gittinger <cg@exept.de>
parents:
5187
diff
changeset
|
2261 |
"/ |
9f0f4d7eaa33
must use full class name (ie. with namespace prefix)
Claus Gittinger <cg@exept.de>
parents:
5187
diff
changeset
|
2262 |
"/ this test allows a smalltalk to be built without Projects/ChangeSets |
9f0f4d7eaa33
must use full class name (ie. with namespace prefix)
Claus Gittinger <cg@exept.de>
parents:
5187
diff
changeset
|
2263 |
"/ |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2264 |
Project notNil ifTrue:[ |
11697 | 2265 |
fileName := Project currentProjectDirectory asFilename construct:(fileName name). |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2266 |
]. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2267 |
|
5192
9f0f4d7eaa33
must use full class name (ie. with namespace prefix)
Claus Gittinger <cg@exept.de>
parents:
5187
diff
changeset
|
2268 |
"/ |
9f0f4d7eaa33
must use full class name (ie. with namespace prefix)
Claus Gittinger <cg@exept.de>
parents:
5187
diff
changeset
|
2269 |
"/ if the file exists, save original in a .sav file |
9f0f4d7eaa33
must use full class name (ie. with namespace prefix)
Claus Gittinger <cg@exept.de>
parents:
5187
diff
changeset
|
2270 |
"/ |
3050
d08734c8be27
use Filename protocol when generating fileNames;
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
2271 |
fileName exists ifTrue:[ |
11697 | 2272 |
fileName copyTo:(fileName withSuffix:'sav') |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2273 |
]. |
11697 | 2274 |
|
7086
40eea91992ec
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
6930
diff
changeset
|
2275 |
[ |
11697 | 2276 |
aStream := fileName newReadWriteStream. |
25178 | 2277 |
] on:OpenError do:[:ex| |
11697 | 2278 |
^ FileOutErrorSignal |
2279 |
raiseRequestWith:fileName name |
|
2280 |
errorString:(' - cannot create file:', fileName name) |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2281 |
]. |
5192
9f0f4d7eaa33
must use full class name (ie. with namespace prefix)
Claus Gittinger <cg@exept.de>
parents:
5187
diff
changeset
|
2282 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2283 |
self fileOutCategory:aCategory on:aStream. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2284 |
aStream close |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2285 |
|
3050
d08734c8be27
use Filename protocol when generating fileNames;
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
2286 |
"Modified: / 1.4.1997 / 16:00:24 / stefan" |
d08734c8be27
use Filename protocol when generating fileNames;
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
2287 |
"Created: / 1.4.1997 / 16:04:18 / stefan" |
d08734c8be27
use Filename protocol when generating fileNames;
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
2288 |
"Modified: / 28.10.1997 / 14:40:28 / cg" |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2289 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2290 |
|
4733
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4648
diff
changeset
|
2291 |
fileOutCategory:aCategory except:skippedMethods only:savedMethods methodFilter:methodFilter on:aStream |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2292 |
"file out all methods belonging to aCategory, aString onto aStream. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2293 |
If skippedMethods is nonNil, those are not saved. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2294 |
If savedMethods is nonNil, only those are saved. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2295 |
If both are nil, all are saved. See version-method handling in |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2296 |
fileOut for what this is needed." |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2297 |
|
11700 | 2298 |
"/ WARNING: will be obsoleted by SmalltalkChunkFileSourceWriter |
2299 |
||
11697 | 2300 |
|source sortedSelectors first privacy interestingMethods cat| |
2301 |
||
2302 |
interestingMethods := self methodsInCategory:aCategory forWhich:methodFilter. |
|
2303 |
interestingMethods := interestingMethods |
|
2304 |
select:[:method | |
|
2305 |
|wanted| |
|
2306 |
||
2307 |
skippedMethods notNil ifTrue:[ |
|
2308 |
wanted := (skippedMethods includesIdentical:method) not |
|
2309 |
] ifFalse:[ |
|
2310 |
savedMethods notNil ifTrue:[ |
|
2311 |
wanted := (savedMethods includesIdentical:method). |
|
2312 |
] ifFalse:[ |
|
2313 |
wanted := true |
|
2314 |
] |
|
2315 |
]. |
|
2316 |
wanted |
|
16281 | 2317 |
] as:OrderedCollection. |
11697 | 2318 |
|
2319 |
interestingMethods notEmpty ifTrue:[ |
|
2320 |
first := true. |
|
2321 |
privacy := nil. |
|
2322 |
||
2323 |
"/ |
|
2324 |
"/ sort by selector |
|
2325 |
"/ |
|
2326 |
sortedSelectors := interestingMethods collect:[:m | self selectorAtMethod:m]. |
|
2327 |
sortedSelectors sortWith:interestingMethods. |
|
2328 |
||
2329 |
interestingMethods do:[:aMethod | |
|
2330 |
first ifFalse:[ |
|
2331 |
privacy ~~ aMethod privacy ifTrue:[ |
|
2332 |
first := true. |
|
2333 |
aStream space. |
|
2334 |
aStream nextPutChunkSeparator. |
|
2335 |
]. |
|
2336 |
aStream cr; cr |
|
2337 |
]. |
|
2338 |
||
2339 |
privacy := aMethod privacy. |
|
2340 |
||
2341 |
first ifTrue:[ |
|
2342 |
aStream nextPutChunkSeparator. |
|
2343 |
self printClassNameOn:aStream. |
|
2344 |
privacy ~~ #public ifTrue:[ |
|
2345 |
aStream space; nextPutAll:privacy; nextPutAll:'MethodsFor:'. |
|
2346 |
] ifFalse:[ |
|
2347 |
aStream nextPutAll:' methodsFor:'. |
|
2348 |
]. |
|
2349 |
cat := aCategory. |
|
2350 |
cat isNil ifTrue:[ cat := '' ]. |
|
2351 |
aStream nextPutAll:aCategory asString storeString. |
|
2352 |
aStream nextPutChunkSeparator; cr; cr. |
|
2353 |
first := false. |
|
2354 |
]. |
|
2355 |
source := aMethod source. |
|
2356 |
source isNil ifTrue:[ |
|
2357 |
FileOutErrorSignal |
|
2358 |
raiseRequestWith:self |
|
2359 |
errorString:' - no source for method: ', (aMethod displayString) |
|
2360 |
] ifFalse:[ |
|
2361 |
aStream nextChunkPut:source. |
|
2362 |
]. |
|
2363 |
]. |
|
2364 |
aStream space. |
|
2365 |
aStream nextPutChunkSeparator. |
|
2366 |
aStream cr |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2367 |
] |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2368 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2369 |
"Modified: 28.8.1995 / 14:30:41 / claus" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2370 |
"Modified: 12.6.1996 / 11:37:33 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2371 |
"Modified: 15.11.1996 / 11:32:21 / cg" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2372 |
"Created: 1.4.1997 / 16:04:33 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2373 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2374 |
|
4733
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4648
diff
changeset
|
2375 |
fileOutCategory:aCategory except:skippedMethods only:savedMethods on:aStream |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4648
diff
changeset
|
2376 |
"file out all methods belonging to aCategory, aString onto aStream. |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4648
diff
changeset
|
2377 |
If skippedMethods is nonNil, those are not saved. |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4648
diff
changeset
|
2378 |
If savedMethods is nonNil, only those are saved. |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4648
diff
changeset
|
2379 |
If both are nil, all are saved. See version-method handling in |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4648
diff
changeset
|
2380 |
fileOut for what this is needed." |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4648
diff
changeset
|
2381 |
|
11700 | 2382 |
"/ WARNING: will be obsoleted by SmalltalkChunkFileSourceWriter |
2383 |
||
4733
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4648
diff
changeset
|
2384 |
self |
11700 | 2385 |
fileOutCategory:aCategory |
2386 |
except:skippedMethods |
|
2387 |
only:savedMethods |
|
2388 |
methodFilter:nil |
|
2389 |
on:aStream |
|
4733
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4648
diff
changeset
|
2390 |
|
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4648
diff
changeset
|
2391 |
"Modified: 28.8.1995 / 14:30:41 / claus" |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4648
diff
changeset
|
2392 |
"Modified: 12.6.1996 / 11:37:33 / stefan" |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4648
diff
changeset
|
2393 |
"Modified: 15.11.1996 / 11:32:21 / cg" |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4648
diff
changeset
|
2394 |
"Created: 1.4.1997 / 16:04:33 / stefan" |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4648
diff
changeset
|
2395 |
! |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4648
diff
changeset
|
2396 |
|
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4648
diff
changeset
|
2397 |
fileOutCategory:aCategory methodFilter:methodFilter on:aStream |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4648
diff
changeset
|
2398 |
"file out all methods belonging to aCategory, aString onto aStream" |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4648
diff
changeset
|
2399 |
|
11700 | 2400 |
"/ WARNING: will be obsoleted by SmalltalkChunkFileSourceWriter |
2401 |
||
4733
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4648
diff
changeset
|
2402 |
self fileOutCategory:aCategory except:nil only:nil methodFilter:methodFilter on:aStream |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4648
diff
changeset
|
2403 |
|
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4648
diff
changeset
|
2404 |
"Created: 1.4.1997 / 16:04:44 / stefan" |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4648
diff
changeset
|
2405 |
! |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4648
diff
changeset
|
2406 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2407 |
fileOutCategory:aCategory on:aStream |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2408 |
"file out all methods belonging to aCategory, aString onto aStream" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2409 |
|
11700 | 2410 |
"/ WARNING: will be obsoleted by SmalltalkChunkFileSourceWriter |
2411 |
||
5192
9f0f4d7eaa33
must use full class name (ie. with namespace prefix)
Claus Gittinger <cg@exept.de>
parents:
5187
diff
changeset
|
2412 |
"/ |
9f0f4d7eaa33
must use full class name (ie. with namespace prefix)
Claus Gittinger <cg@exept.de>
parents:
5187
diff
changeset
|
2413 |
"/ must use the classes full name |
9f0f4d7eaa33
must use full class name (ie. with namespace prefix)
Claus Gittinger <cg@exept.de>
parents:
5187
diff
changeset
|
2414 |
"/ |
9f0f4d7eaa33
must use full class name (ie. with namespace prefix)
Claus Gittinger <cg@exept.de>
parents:
5187
diff
changeset
|
2415 |
Class fileOutNameSpaceQuerySignal answer:true do:[ |
11700 | 2416 |
self fileOutCategory:aCategory except:nil only:nil methodFilter:nil on:aStream |
5192
9f0f4d7eaa33
must use full class name (ie. with namespace prefix)
Claus Gittinger <cg@exept.de>
parents:
5187
diff
changeset
|
2417 |
] |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2418 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2419 |
"Created: 1.4.1997 / 16:04:44 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2420 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2421 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2422 |
fileOutMethod:aMethod |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2423 |
"create a file 'class-method.st' consisting of the method, aMethod. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2424 |
If the current project is not nil, create the file in the projects |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2425 |
directory." |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2426 |
|
11700 | 2427 |
"/ WARNING: will be obsoleted by SmalltalkChunkFileSourceWriter |
2428 |
||
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2429 |
|aStream fileName selector| |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2430 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2431 |
selector := self selectorAtMethod:aMethod. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2432 |
selector notNil ifTrue:[ |
11700 | 2433 |
fileName := (self name , '-' , selector, '.st') asFilename. |
2434 |
fileName makeLegalFilename. |
|
2435 |
||
2436 |
" |
|
2437 |
this test allows a smalltalk to be built without Projects/ChangeSets |
|
2438 |
" |
|
2439 |
Project notNil ifTrue:[ |
|
2440 |
fileName := Project currentProjectDirectory asFilename construct:fileName name. |
|
2441 |
]. |
|
2442 |
||
2443 |
" |
|
2444 |
if file exists, save original in a .sav file |
|
2445 |
" |
|
2446 |
fileName exists ifTrue:[ |
|
2447 |
fileName copyTo:(fileName withSuffix: 'sav') |
|
2448 |
]. |
|
2449 |
||
2450 |
[ |
|
2451 |
aStream := fileName newReadWriteStream. |
|
25178 | 2452 |
] on:OpenError do:[:ex| |
11700 | 2453 |
^ FileOutErrorSignal |
2454 |
raiseRequestWith:fileName name |
|
2455 |
errorString:(' - cannot create file:', fileName name) |
|
2456 |
]. |
|
2457 |
self fileOutMethod:aMethod on:aStream. |
|
2458 |
aStream close |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2459 |
] |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2460 |
|
3050
d08734c8be27
use Filename protocol when generating fileNames;
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
2461 |
"Modified: / 1.4.1997 / 16:00:57 / stefan" |
d08734c8be27
use Filename protocol when generating fileNames;
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
2462 |
"Created: / 2.4.1997 / 00:24:28 / stefan" |
d08734c8be27
use Filename protocol when generating fileNames;
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
2463 |
"Modified: / 28.10.1997 / 14:40:34 / cg" |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2464 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2465 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2466 |
fileOutMethod:aMethod on:aStream |
11697 | 2467 |
"file out aMethod onto aStream. Used for example to write individual changeChunks" |
2468 |
||
11700 | 2469 |
"/ WARNING: will be obsoleted by SmalltalkChunkFileSourceWriter |
2470 |
||
11697 | 2471 |
|cat source privacy| |
2472 |
||
2473 |
aStream nextPutChunkSeparator. |
|
2474 |
self name printOn:aStream. |
|
5193
a54e016b1b30
must use full class name (ie. with namespace prefix)
Claus Gittinger <cg@exept.de>
parents:
5192
diff
changeset
|
2475 |
"/ self printClassNameOn:aStream. |
a54e016b1b30
must use full class name (ie. with namespace prefix)
Claus Gittinger <cg@exept.de>
parents:
5192
diff
changeset
|
2476 |
|
11697 | 2477 |
(privacy := aMethod privacy) ~~ #public ifTrue:[ |
2478 |
aStream space; nextPutAll:privacy; nextPutAll:'MethodsFor:'. |
|
2479 |
] ifFalse:[ |
|
2480 |
aStream nextPutAll:' methodsFor:'. |
|
2481 |
]. |
|
2482 |
||
23824 | 2483 |
cat := aMethod category ? '* no category *'. |
11697 | 2484 |
aStream nextPutAll:cat asString storeString. |
2485 |
aStream nextPutChunkSeparator; cr; cr. |
|
2486 |
||
2487 |
source := aMethod source. |
|
2488 |
source isNil ifTrue:[ |
|
2489 |
FileOutErrorSignal |
|
2490 |
raiseRequestWith:self |
|
2491 |
errorString:(' - no source for method: ' , |
|
2492 |
self name , '>>' , |
|
2493 |
(self selectorAtMethod:aMethod)) |
|
2494 |
] ifFalse:[ |
|
2495 |
aStream nextChunkPut:source. |
|
2496 |
]. |
|
2497 |
aStream space. |
|
2498 |
aStream nextPutChunkSeparator. |
|
2499 |
aStream cr |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2500 |
|
23824 | 2501 |
"Modified: / 27-08-1995 / 01:23:19 / claus" |
2502 |
"Modified: / 12-06-1996 / 11:44:41 / stefan" |
|
2503 |
"Modified: / 15-11-1996 / 11:32:43 / cg" |
|
2504 |
"Created: / 02-04-1997 / 00:24:33 / stefan" |
|
2505 |
"Modified: / 03-03-2019 / 22:26:47 / Claus Gittinger" |
|
5216 | 2506 |
! |
2507 |
||
2508 |
fileOutMethods:methods on:aStream |
|
11700 | 2509 |
"/ WARNING: will be obsoleted by SmalltalkChunkFileSourceWriter |
2510 |
||
5216 | 2511 |
methods do:[:aMethod | |
11700 | 2512 |
self fileOutMethod:aMethod on:aStream |
5216 | 2513 |
]. |
2514 |
||
2515 |
"Created: / 29.1.2000 / 16:39:53 / cg" |
|
2516 |
"Modified: / 29.1.2000 / 16:40:59 / cg" |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2517 |
! ! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2518 |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5369
diff
changeset
|
2519 |
!ClassDescription methodsFor:'fileOut-xml'! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5369
diff
changeset
|
2520 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5369
diff
changeset
|
2521 |
fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5369
diff
changeset
|
2522 |
"file out all methods belonging to aCategory, aString in xml format onto aStream." |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5369
diff
changeset
|
2523 |
|
11700 | 2524 |
"/ WARNING: will be obsoleted by XMLChunkFileWriter (or similar) |
2525 |
||
11697 | 2526 |
|source sortedSelectors first privacy interestingMethods cat| |
2527 |
||
16281 | 2528 |
interestingMethods := (self methodsInCategory:aCategory forWhich:methodFilter) asOrderedCollection. |
11697 | 2529 |
interestingMethods notEmpty ifTrue:[ |
2530 |
first := true. |
|
2531 |
privacy := nil. |
|
2532 |
||
2533 |
"/ |
|
2534 |
"/ sort by selector |
|
2535 |
"/ |
|
2536 |
sortedSelectors := interestingMethods collect:[:m | self selectorAtMethod:m]. |
|
2537 |
sortedSelectors sortWith:interestingMethods. |
|
2538 |
||
2539 |
interestingMethods do:[:aMethod | |
|
2540 |
first ifFalse:[ |
|
2541 |
privacy ~~ aMethod privacy ifTrue:[ |
|
2542 |
first := true. |
|
2543 |
aStream nextPutLine:'</methods>'. |
|
2544 |
]. |
|
2545 |
]. |
|
2546 |
||
2547 |
privacy := aMethod privacy. |
|
2548 |
||
2549 |
first ifTrue:[ |
|
2550 |
cat := aCategory. |
|
2551 |
cat isNil ifTrue:[ cat := '' ]. |
|
2552 |
||
2553 |
aStream nextPutLine:'<methods>'. |
|
2554 |
aStream nextPutAll:' <class-id>'. |
|
2555 |
aStream nextPutAll:self name. |
|
2556 |
aStream nextPutLine:'</class-id>'. |
|
2557 |
aStream nextPutAll:' <category>'. |
|
2558 |
aStream nextPutAll:cat. |
|
2559 |
aStream nextPutLine:'</category>'. |
|
2560 |
||
2561 |
privacy ~~ #public ifTrue:[ |
|
2562 |
aStream nextPutAll:' <privacy>'. |
|
2563 |
aStream nextPutAll:privacy. |
|
2564 |
aStream nextPutLine:'</privacy>'. |
|
2565 |
]. |
|
2566 |
first := false. |
|
2567 |
]. |
|
2568 |
source := aMethod source. |
|
2569 |
source isNil ifTrue:[ |
|
2570 |
FileOutErrorSignal |
|
2571 |
raiseRequestWith:self |
|
2572 |
errorString:' - no source for method: ', (aMethod displayString) |
|
2573 |
] ifFalse:[ |
|
2574 |
aStream nextPutAll:' <body>'. |
|
15790 | 2575 |
source printXmlTextQuotedOn:aStream. |
11697 | 2576 |
aStream nextPutLine:'</body>'. |
2577 |
]. |
|
2578 |
]. |
|
2579 |
aStream nextPutLine:'</methods>'. |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5369
diff
changeset
|
2580 |
] |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5369
diff
changeset
|
2581 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5369
diff
changeset
|
2582 |
|
5465 | 2583 |
fileOutXMLMethod:aMethod on:aStream |
2584 |
"file out a method in xml format onto aStream." |
|
2585 |
||
11700 | 2586 |
"/ WARNING: will be obsoleted by XMLChunkFileWriter (or similar) |
2587 |
||
5465 | 2588 |
|source privacy| |
2589 |
||
2590 |
privacy := aMethod privacy. |
|
2591 |
||
2592 |
aStream nextPutLine:'<methods>'. |
|
2593 |
aStream nextPutAll:' <class-id>'. |
|
2594 |
aStream nextPutAll:self name. |
|
2595 |
aStream nextPutLine:'</class-id>'. |
|
2596 |
aStream nextPutAll:' <category>'. |
|
23824 | 2597 |
aStream nextPutAll:(aMethod category ? '* no category *'). |
5465 | 2598 |
aStream nextPutLine:'</category>'. |
2599 |
||
2600 |
privacy ~~ #public ifTrue:[ |
|
11700 | 2601 |
aStream nextPutAll:' <privacy>'. |
2602 |
aStream nextPutAll:privacy. |
|
2603 |
aStream nextPutLine:'</privacy>'. |
|
5465 | 2604 |
]. |
2605 |
||
2606 |
source := aMethod source. |
|
2607 |
source isNil ifTrue:[ |
|
11700 | 2608 |
FileOutErrorSignal |
2609 |
raiseRequestWith:self |
|
2610 |
errorString:' - no source for method: ', (aMethod displayString) |
|
5465 | 2611 |
] ifFalse:[ |
11700 | 2612 |
aStream nextPutAll:' <body>'. |
15790 | 2613 |
source printXmlTextQuotedOn:aStream. |
11700 | 2614 |
aStream nextPutLine:' </body>'. |
5465 | 2615 |
]. |
2616 |
aStream nextPutLine:'</methods>'. |
|
23824 | 2617 |
|
2618 |
"Modified: / 03-03-2019 / 22:27:06 / Claus Gittinger" |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5369
diff
changeset
|
2619 |
! ! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5369
diff
changeset
|
2620 |
|
22028 | 2621 |
!ClassDescription methodsFor:'initialization'! |
2622 |
||
2623 |
initializeWithAllPrivateClasses |
|
2624 |
"if implemented, send #initialize to myself and any private |
|
2625 |
class which does so. |
|
2626 |
This is sent to a class after it |
|
2627 |
has been loaded into the system. |
|
2628 |
Statically compiled classes are initialized by the VM" |
|
2629 |
||
2630 |
(self class includesSelector:#initialize) ifTrue:[ |
|
2631 |
self initialize. |
|
2632 |
]. |
|
2633 |
self privateClassesSorted do:[:aPrivateClass | |
|
2634 |
aPrivateClass initializeWithAllPrivateClasses. |
|
2635 |
]. |
|
2636 |
||
2637 |
"Created: / 13.5.1998 / 23:33:16 / cg" |
|
2638 |
"Modified: / 13.5.1998 / 23:34:06 / cg" |
|
2639 |
! ! |
|
2640 |
||
22442 | 2641 |
|
2483
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2642 |
!ClassDescription methodsFor:'printOut'! |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2643 |
|
4648 | 2644 |
nameWithNameSpacePrefix |
18975 | 2645 |
"return my name's printString, |
21422 | 2646 |
with nameSpace prefix (even if it's the Smalltalk namespace)" |
4648 | 2647 |
|
2648 |
|nm owner| |
|
2649 |
||
2650 |
(owner := self owningClass) notNil ifTrue:[ |
|
18975 | 2651 |
^ (owner nameWithNameSpacePrefix , '::' , self nameWithoutPrefix) |
8551 | 2652 |
]. |
4648 | 2653 |
|
2654 |
nm := self name. |
|
2655 |
self nameSpace == Smalltalk ifTrue:[ |
|
18975 | 2656 |
nm := 'Smalltalk::' , nm |
4648 | 2657 |
]. |
2658 |
^ nm |
|
2659 |
||
2660 |
"a public class: |
|
8551 | 2661 |
Array name |
2662 |
Array nameWithoutPrefix |
|
2663 |
Array nameWithoutNameSpacePrefix |
|
2664 |
Array nameWithNameSpacePrefix |
|
4648 | 2665 |
" |
2666 |
||
2667 |
"a private class: |
|
8551 | 2668 |
Method::MethodWhoInfo name |
2669 |
Method::MethodWhoInfo nameWithoutPrefix |
|
2670 |
Method::MethodWhoInfo nameWithoutNameSpacePrefix |
|
2671 |
Method::MethodWhoInfo nameWithNameSpacePrefix |
|
4648 | 2672 |
" |
2673 |
||
2674 |
"a namespace class: |
|
8551 | 2675 |
CodingExamples::TopClass name |
2676 |
CodingExamples::TopClass nameWithoutPrefix |
|
4648 | 2677 |
CodingExamples::TopClass nameWithoutNameSpacePrefix |
2678 |
CodingExamples::TopClass nameWithNameSpacePrefix |
|
2679 |
" |
|
2680 |
||
2681 |
"a private class in a namespace class: |
|
8551 | 2682 |
CodingExamples::TopClass::SubClass name |
2683 |
CodingExamples::TopClass::SubClass nameWithoutPrefix |
|
4648 | 2684 |
CodingExamples::TopClass::SubClass nameWithoutNameSpacePrefix |
2685 |
CodingExamples::TopClass::SubClass nameWithNameSpacePrefix |
|
2686 |
" |
|
2687 |
||
21422 | 2688 |
"Modified: / 05-01-1997 / 18:22:57 / cg" |
2689 |
"Created: / 01-04-1997 / 16:20:13 / stefan" |
|
2690 |
"Modified (comment): / 13-02-2017 / 19:58:14 / cg" |
|
4648 | 2691 |
! |
2692 |
||
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2693 |
nameWithoutNameSpacePrefix |
8551 | 2694 |
"helper for fileOut and others - return my names printString, |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2695 |
without any nameSpace prefix (but with owningClasses prefix)" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2696 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2697 |
|nm owner| |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2698 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2699 |
nm := self nameWithoutPrefix. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2700 |
(owner := self owningClass) isNil ifTrue:[ |
3918
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
2701 |
^ nm |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2702 |
]. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2703 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2704 |
^ (owner nameWithoutNameSpacePrefix , '::' , nm) |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2705 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2706 |
"a public class: |
8551 | 2707 |
Array name |
2708 |
Array nameWithoutPrefix |
|
2709 |
Array nameWithoutNameSpacePrefix |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2710 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2711 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2712 |
"a private class: |
8551 | 2713 |
Method::MethodWhoInfo name |
2714 |
Method::MethodWhoInfo nameWithoutPrefix |
|
2715 |
Method::MethodWhoInfo nameWithoutNameSpacePrefix |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2716 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2717 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2718 |
"a namespace class: |
8551 | 2719 |
CodingExamples::TopClass name |
2720 |
CodingExamples::TopClass nameWithoutPrefix |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2721 |
CodingExamples::TopClass nameWithoutNameSpacePrefix |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2722 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2723 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2724 |
"a private class in a namespace class: |
8551 | 2725 |
CodingExamples::TopClass::SubClass name |
2726 |
CodingExamples::TopClass::SubClass nameWithoutPrefix |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2727 |
CodingExamples::TopClass::SubClass nameWithoutNameSpacePrefix |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2728 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2729 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2730 |
"Modified: 5.1.1997 / 18:22:57 / cg" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2731 |
"Created: 1.4.1997 / 16:20:13 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2732 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2733 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2734 |
nameWithoutPrefix |
8551 | 2735 |
"helper for fileOut and others - return my names printString, |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2736 |
without any owningClass or nameSpace prefix" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2737 |
|
12003 | 2738 |
^ Class nameWithoutPrefix:self name |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2739 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2740 |
"a public class: |
8551 | 2741 |
Array name |
2742 |
Array nameWithoutPrefix |
|
2743 |
Array nameWithoutNameSpacePrefix |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2744 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2745 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2746 |
"a private class: |
8551 | 2747 |
Method::MethodWhoInfo name |
2748 |
Method::MethodWhoInfo nameWithoutPrefix |
|
2749 |
Method::MethodWhoInfo nameWithoutNameSpacePrefix |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2750 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2751 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2752 |
"a namespace class: |
8551 | 2753 |
Demos::WalkingGirl name |
2754 |
Demos::WalkingGirl nameWithoutPrefix |
|
2755 |
Demos::WalkingGirl nameWithoutNameSpacePrefix |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2756 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2757 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2758 |
"a private class in a namespace class: |
8551 | 2759 |
Demos::WalkingGirl::AnimationView name |
2760 |
Demos::WalkingGirl::AnimationView nameWithoutPrefix |
|
2761 |
Demos::WalkingGirl::AnimationView nameWithoutNameSpacePrefix |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2762 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2763 |
|
9527 | 2764 |
"Created: / 01-04-1997 / 16:20:34 / stefan" |
2765 |
"Modified: / 11-08-2006 / 12:58:02 / cg" |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2766 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2767 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2768 |
printClassNameOn:aStream |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2769 |
"helper for fileOut - print my name. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2770 |
Private classes always print their owning-class as nameSpace |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2771 |
prefix; non-private ones print without, except if the |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2772 |
FileOutNameSpaceQuery returns true. The last feature is used |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2773 |
with changefile updates - here, the full name is wanted." |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2774 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2775 |
|nm| |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2776 |
|
4056
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
2777 |
Class fileOutNameSpaceQuerySignal query == false ifTrue:[ |
8551 | 2778 |
nm := self nameWithoutNameSpacePrefix |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2779 |
] ifFalse:[ |
8551 | 2780 |
nm := self name. |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2781 |
]. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2782 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2783 |
aStream nextPutAll:nm. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2784 |
|
4056
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
2785 |
"Modified: / 3.1.1997 / 20:41:26 / cg" |
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
2786 |
"Created: / 1.4.1997 / 16:06:57 / stefan" |
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
2787 |
"Modified: / 18.3.1999 / 18:17:21 / stefan" |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2788 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
2789 |
|
2483
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2790 |
printHierarchyAnswerIndentOn:aStream |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2791 |
"print my class hierarchy on aStream - return indent |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2792 |
recursively calls itself to print superclass and use returned indent |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2793 |
for my description - used in the browser" |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2794 |
|
6394
492964c0fd9b
instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents:
6393
diff
changeset
|
2795 |
|indent nm superclass| |
2483
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2796 |
|
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2797 |
indent := 0. |
6394
492964c0fd9b
instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents:
6393
diff
changeset
|
2798 |
superclass := self superclass. |
2483
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2799 |
(superclass notNil) ifTrue:[ |
8551 | 2800 |
indent := (superclass printHierarchyAnswerIndentOn:aStream) + 2 |
2483
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2801 |
]. |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2802 |
aStream spaces:indent. |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2803 |
nm := self printNameInHierarchy. |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2804 |
aStream nextPutAll:nm; nextPutAll:' ('. |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2805 |
self printInstVarNamesOn:aStream indent:(indent + nm size + 2). |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2806 |
aStream nextPutLine:')'. |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2807 |
^ indent |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2808 |
|
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2809 |
"Created: 22.3.1997 / 14:11:29 / cg" |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2810 |
"Modified: 22.3.1997 / 14:15:42 / cg" |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2811 |
! |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2812 |
|
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2813 |
printHierarchyOn:aStream |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2814 |
"print my class hierarchy on aStream" |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2815 |
|
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2816 |
self printHierarchyAnswerIndentOn:aStream |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2817 |
|
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2818 |
"Created: 22.3.1997 / 14:11:13 / cg" |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2819 |
! |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2820 |
|
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2821 |
printInstVarNamesOn:aStream indent:indent |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2822 |
"print the instance variable names indented and breaking at line end" |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2823 |
|
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2824 |
self printNameArray:(self instVarNames) on:aStream indent:indent |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2825 |
|
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2826 |
"Created: 22.3.1997 / 14:12:00 / cg" |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2827 |
! |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2828 |
|
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2829 |
printNameArray:anArray on:aStream indent:indent |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2830 |
"print an array of strings separated by spaces; when the stream |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2831 |
defines a lineLength, break when this limit is reached; indent |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2832 |
every line; used to printOut instance variable names" |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2833 |
|
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2834 |
|thisName nextName arraySize lenMax pos mustBreak line spaces| |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2835 |
|
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2836 |
arraySize := anArray size. |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2837 |
arraySize ~~ 0 ifTrue:[ |
3918
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
2838 |
pos := indent. |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
2839 |
lenMax := aStream lineLength. |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
2840 |
thisName := anArray at:1. |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
2841 |
line := ''. |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
2842 |
1 to:arraySize do:[:index | |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
2843 |
line := line , thisName. |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
2844 |
pos := pos + thisName size. |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
2845 |
(index == arraySize) ifFalse:[ |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
2846 |
nextName := anArray at:(index + 1). |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
2847 |
mustBreak := false. |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
2848 |
(lenMax > 0) ifTrue:[ |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
2849 |
((pos + nextName size) > lenMax) ifTrue:[ |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
2850 |
mustBreak := true |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
2851 |
] |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
2852 |
]. |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
2853 |
mustBreak ifTrue:[ |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
2854 |
aStream nextPutLine:line withTabs. |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
2855 |
spaces isNil ifTrue:[ |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
2856 |
spaces := String new:indent |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
2857 |
]. |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
2858 |
line := spaces. |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
2859 |
pos := indent |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
2860 |
] ifFalse:[ |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
2861 |
line := line , ' '. |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
2862 |
pos := pos + 1 |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
2863 |
]. |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
2864 |
thisName := nextName |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
2865 |
] |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
2866 |
]. |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
2867 |
aStream nextPutAll:line withTabs |
2483
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2868 |
] |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2869 |
|
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2870 |
"Modified: 9.11.1996 / 00:12:06 / cg" |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2871 |
"Created: 22.3.1997 / 14:12:12 / cg" |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2872 |
! |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2873 |
|
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2874 |
printNameInHierarchy |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2875 |
"return my name as printed in the hierarchy" |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2876 |
|
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2877 |
^ self name |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2878 |
|
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2879 |
"Created: 22.3.1997 / 14:15:36 / cg" |
3230
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2880 |
! |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2881 |
|
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2882 |
printOutCategory:aCategory on:aPrintStream |
14617 | 2883 |
"print out all methods in aCategory on aPrintStream, which should understand emphasis" |
11697 | 2884 |
|
16281 | 2885 |
|interestingMethods sortedSelectors| |
2886 |
||
2887 |
interestingMethods := (self methodsInCategory:aCategory) asOrderedCollection. |
|
2888 |
sortedSelectors := interestingMethods collect:[:m | self selectorAtMethod:m]. |
|
2889 |
sortedSelectors sortWith:interestingMethods. |
|
11697 | 2890 |
interestingMethods notEmptyOrNil ifTrue:[ |
2891 |
aPrintStream italic. |
|
2892 |
aPrintStream nextPutAll:aCategory. |
|
2893 |
aPrintStream normal. |
|
2894 |
aPrintStream cr; cr. |
|
2895 |
interestingMethods do:[:aMethod | |
|
14617 | 2896 |
aMethod source notEmptyOrNil ifTrue:[ |
2897 |
self printOutSource:(aMethod source) on:aPrintStream. |
|
2898 |
aPrintStream cr; cr. |
|
2899 |
]. |
|
11697 | 2900 |
]. |
2901 |
aPrintStream cr |
|
3230
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2902 |
] |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2903 |
|
16281 | 2904 |
" |
2905 |
ClassDescription printOutCategory:'queries' on:Transcript |
|
2906 |
" |
|
2907 |
||
3230
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2908 |
"Modified: / 12.6.1996 / 11:47:36 / stefan" |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2909 |
"Created: / 28.1.1998 / 00:27:03 / cg" |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2910 |
! |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2911 |
|
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2912 |
printOutSource:aString on:aPrintStream |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2913 |
"print out a source-string; the message-specification is printed bold, |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2914 |
comments are printed italic" |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2915 |
|
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2916 |
|text textIndex textSize line lineIndex lineSize inComment aCharacter| |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2917 |
text := aString asStringCollection. |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2918 |
aPrintStream bold. |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2919 |
aPrintStream nextPutAll:(text at:1). |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2920 |
aPrintStream normal. |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2921 |
aPrintStream cr. |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2922 |
inComment := false. |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2923 |
textSize := text size. |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2924 |
textIndex := 2. |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2925 |
[textIndex <= textSize] whileTrue:[ |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2926 |
line := text at:textIndex. |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2927 |
((line occurrencesOf:Character doubleQuote) == 0) ifTrue:[ |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2928 |
aPrintStream nextPutAll:line |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2929 |
] ifFalse:[ |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2930 |
lineSize := line size. |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2931 |
lineIndex := 1. |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2932 |
[lineIndex <= lineSize] whileTrue:[ |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2933 |
aCharacter := line at:lineIndex. |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2934 |
(aCharacter == Character doubleQuote) ifTrue:[ |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2935 |
inComment ifTrue:[ |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2936 |
aPrintStream normal. |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2937 |
aPrintStream nextPut:aCharacter. |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2938 |
inComment := false |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2939 |
] ifFalse:[ |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2940 |
aPrintStream nextPut:aCharacter. |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2941 |
aPrintStream italic. |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2942 |
inComment := true |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2943 |
] |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2944 |
] ifFalse:[ |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2945 |
aPrintStream nextPut:aCharacter |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2946 |
]. |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2947 |
lineIndex := lineIndex + 1 |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2948 |
] |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2949 |
]. |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2950 |
aPrintStream cr. |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2951 |
textIndex := textIndex + 1 |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2952 |
] |
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2953 |
|
dc74552b86de
had to move some printOut methods from class to here;
Claus Gittinger <cg@exept.de>
parents:
3219
diff
changeset
|
2954 |
"Created: / 28.1.1998 / 00:27:25 / cg" |
2483
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2955 |
! ! |
fb469352be7d
moved some printOut methods from Class to here.
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
2956 |
|
92 | 2957 |
!ClassDescription methodsFor:'printing & storing'! |
68 | 2958 |
|
14295
7ce0d687b3be
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
14240
diff
changeset
|
2959 |
displayOn:aGCOrStream |
293 | 2960 |
"return a string for display in inspectors" |
2961 |
||
14295
7ce0d687b3be
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
14240
diff
changeset
|
2962 |
|cat| |
7ce0d687b3be
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
14240
diff
changeset
|
2963 |
|
7ce0d687b3be
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
14240
diff
changeset
|
2964 |
"/ what a kludge - Dolphin and Squeak mean: printOn: a stream; |
21533 | 2965 |
"/ old ST80 means: draw-yourself on a GC. |
14295
7ce0d687b3be
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
14240
diff
changeset
|
2966 |
(aGCOrStream isStream) ifFalse:[ |
7ce0d687b3be
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
14240
diff
changeset
|
2967 |
^ super displayOn:aGCOrStream |
155 | 2968 |
]. |
293 | 2969 |
|
1745 | 2970 |
self isPrivate ifTrue:[ |
14295
7ce0d687b3be
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
14240
diff
changeset
|
2971 |
aGCOrStream |
7ce0d687b3be
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
14240
diff
changeset
|
2972 |
nextPutAll:self nameWithoutPrefix; |
7ce0d687b3be
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
14240
diff
changeset
|
2973 |
nextPutAll:' (private in '; |
7ce0d687b3be
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
14240
diff
changeset
|
2974 |
nextPutAll:self owningClass name; |
7ce0d687b3be
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
14240
diff
changeset
|
2975 |
nextPut:$). |
1745 | 2976 |
] ifFalse:[ |
14627 | 2977 |
aGCOrStream nextPutAll:self name ? '*unnamed*'. |
14295
7ce0d687b3be
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
14240
diff
changeset
|
2978 |
]. |
7ce0d687b3be
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
14240
diff
changeset
|
2979 |
|
7ce0d687b3be
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
14240
diff
changeset
|
2980 |
cat := self category. |
7ce0d687b3be
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
14240
diff
changeset
|
2981 |
(cat = 'obsolete' |
7ce0d687b3be
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
14240
diff
changeset
|
2982 |
or:[cat = '* obsolete *']) ifTrue:[ |
7ce0d687b3be
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
14240
diff
changeset
|
2983 |
"add obsolete - to make life easier ..." |
7ce0d687b3be
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
14240
diff
changeset
|
2984 |
aGCOrStream nextPutAll:' (obsolete)'. |
1745 | 2985 |
]. |
14295
7ce0d687b3be
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
14240
diff
changeset
|
2986 |
(cat = 'removed' |
7ce0d687b3be
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
14240
diff
changeset
|
2987 |
or:[cat = '* removed *']) ifTrue:[ |
7ce0d687b3be
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
14240
diff
changeset
|
2988 |
"add removed - to make life easier ..." |
7ce0d687b3be
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
14240
diff
changeset
|
2989 |
aGCOrStream nextPutAll:' (removed)'. |
7ce0d687b3be
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
14240
diff
changeset
|
2990 |
]. |
7ce0d687b3be
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
14240
diff
changeset
|
2991 |
self isLoaded ifFalse:[ |
7ce0d687b3be
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
14240
diff
changeset
|
2992 |
aGCOrStream nextPutAll:' (autoloaded)'. |
7ce0d687b3be
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
14240
diff
changeset
|
2993 |
]. |
1652 | 2994 |
|
21533 | 2995 |
"Modified: / 15-10-1996 / 20:01:30 / cg" |
2996 |
"Modified: / 01-04-1997 / 15:49:13 / stefan" |
|
2997 |
"Modified (format): / 22-02-2017 / 16:48:36 / cg" |
|
620 | 2998 |
! ! |
2999 |
||
7258 | 3000 |
!ClassDescription methodsFor:'private-changes management'! |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3001 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3002 |
addChangeRecordForMethod:aMethod to:aStream |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3003 |
"{ Pragma: +optSpace }" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3004 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3005 |
"append a method-change-record to aStream" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3006 |
|
8161 | 3007 |
self fileOutMethod:aMethod on:aStream |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3008 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3009 |
"Created: 2.4.1997 / 17:31:46 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3010 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3011 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3012 |
addChangeRecordForMethodCategory:aMethod category:newCategory to:aStream |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3013 |
"{ Pragma: +optSpace }" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3014 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3015 |
"append a methodCategory-change-record to aStream" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3016 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3017 |
|selector| |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3018 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3019 |
selector := aMethod selector. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3020 |
selector notNil ifTrue:[ |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3021 |
aStream nextPutAll:'('. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3022 |
self printClassNameOn:aStream. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3023 |
aStream nextPutAll:(' compiledMethodAt:' , selector storeString). |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3024 |
aStream nextPutAll:(') category:' , newCategory storeString). |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3025 |
aStream nextPutChunkSeparator. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3026 |
] |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3027 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3028 |
"Created: 2.4.1997 / 17:31:56 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3029 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3030 |
|
10060 | 3031 |
addChangeRecordForMethodPackage:aMethod package:newPackageSymbol to:aStream |
3032 |
"{ Pragma: +optSpace }" |
|
3033 |
||
3034 |
"append a methodPackage-change-record to aStream" |
|
3035 |
||
3036 |
|selector| |
|
3037 |
||
3038 |
selector := aMethod selector. |
|
3039 |
selector notNil ifTrue:[ |
|
3040 |
aStream nextPutAll:'('. |
|
3041 |
self printClassNameOn:aStream. |
|
3042 |
aStream nextPutAll:(' compiledMethodAt:' , selector storeString). |
|
3043 |
aStream nextPutAll:(') package:' , newPackageSymbol storeString). |
|
3044 |
aStream nextPutChunkSeparator. |
|
3045 |
] |
|
3046 |
||
3047 |
"Created: / 09-10-2006 / 13:53:13 / cg" |
|
3048 |
! |
|
3049 |
||
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3050 |
addChangeRecordForMethodPrivacy:aMethod to:aStream |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3051 |
"{ Pragma: +optSpace }" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3052 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3053 |
"append a method-privacy-change-record to aStream" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3054 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3055 |
|selector| |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3056 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3057 |
selector := aMethod selector. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3058 |
selector notNil ifTrue:[ |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3059 |
aStream nextPutAll:'('. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3060 |
self printClassNameOn:aStream. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3061 |
aStream nextPutAll:(' compiledMethodAt:' , selector storeString). |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3062 |
aStream nextPutAll:(') privacy:' , aMethod privacy storeString). |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3063 |
aStream nextPutChunkSeparator. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3064 |
] |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3065 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3066 |
"Modified: 27.8.1995 / 22:59:56 / claus" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3067 |
"Created: 2.4.1997 / 17:32:04 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3068 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3069 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3070 |
addChangeRecordForRemoveSelector:aSelector to:aStream |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3071 |
"{ Pragma: +optSpace }" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3072 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3073 |
"append a method-remove-record to aStream" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3074 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3075 |
self printClassNameOn:aStream. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3076 |
aStream nextPutAll:(' removeSelector:' , aSelector asSymbol storeString). |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3077 |
aStream nextPutChunkSeparator. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3078 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3079 |
"Modified: 1.7.1996 / 21:27:55 / cg" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3080 |
"Created: 2.4.1997 / 17:32:31 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3081 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3082 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3083 |
addChangeRecordForRenameCategory:oldCategory to:newCategory to:aStream |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3084 |
"{ Pragma: +optSpace }" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3085 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3086 |
"append a category-rename record to aStream" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3087 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3088 |
self printClassNameOn:aStream. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3089 |
aStream nextPutAll:(' renameCategory:' , oldCategory storeString). |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3090 |
aStream nextPutAll:(' to:' , newCategory storeString). |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3091 |
aStream nextPutChunkSeparator. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3092 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3093 |
"Created: 2.4.1997 / 17:32:44 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3094 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3095 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3096 |
addInfoRecord:aMessage to:aStream |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3097 |
"{ Pragma: +optSpace }" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3098 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3099 |
"append an info-record (snapshot, class fileOut etc.) to aStream" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3100 |
|
8116 | 3101 |
aStream nextPutAll:'''---- '; nextPutAll:aMessage; nextPutAll:' '. |
3102 |
Date today printOn:aStream language:#en. "/ MUST be english !!!! |
|
7960
4273391649c8
info record must use english date
Claus Gittinger <cg@exept.de>
parents:
7952
diff
changeset
|
3103 |
aStream nextPutAll:' '. |
4273391649c8
info record must use english date
Claus Gittinger <cg@exept.de>
parents:
7952
diff
changeset
|
3104 |
Time now printOn:aStream. |
4273391649c8
info record must use english date
Claus Gittinger <cg@exept.de>
parents:
7952
diff
changeset
|
3105 |
aStream nextPutAll:' ----'''. |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3106 |
aStream nextPutChunkSeparator. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3107 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3108 |
"Created: 2.4.1997 / 17:33:42 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3109 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3110 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3111 |
writingChangeDo:aBlock |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3112 |
"{ Pragma: +optSpace }" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3113 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3114 |
"common helper to write a change record. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3115 |
Opens the changefile and executes aBlock passing the stream |
2689 | 3116 |
as argument. WriteErrors are caught and will lead to a warning. |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3117 |
The changefile is not kept open, to force the change to go to disk |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3118 |
as soon as possible - thus, in case of a crash, no changes should |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3119 |
be lost due to buffering." |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3120 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3121 |
self writingChangeWithTimeStamp:true do:aBlock |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3122 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3123 |
"Modified: 18.11.1995 / 15:43:36 / cg" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3124 |
"Created: 2.4.1997 / 17:32:57 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3125 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3126 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3127 |
writingChangePerform:aSelector with:anArgument |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3128 |
"{ Pragma: +optSpace }" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3129 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3130 |
self writingChangeWithTimeStamp:true perform:aSelector with:anArgument |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3131 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3132 |
"Modified: 18.11.1995 / 15:44:53 / cg" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3133 |
"Created: 2.4.1997 / 17:33:03 / stefan" |
620 | 3134 |
! |
3135 |
||
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3136 |
writingChangeWithTimeStamp:doStampIt do:aBlock |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3137 |
"{ Pragma: +optSpace }" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3138 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3139 |
"common helper to write a change record. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3140 |
Opens the changefile and executes aBlock passing the stream |
2689 | 3141 |
as argument. WriteErrors are caught and will lead to a warning. |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3142 |
The changefile is not kept open, to force the change to go to disk |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3143 |
as soon as possible - thus, in case of a crash, no changes should |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3144 |
be lost due to buffering. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3145 |
Access to the change file is serialized via the accessLock; |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3146 |
this prevents the changefile to be corrupted when multiple users |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3147 |
accept in the browser in a multi-display (or timesliced) configuration" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3148 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3149 |
ChangeFileAccessLock critical:[ |
25295 | 3150 |
|aStream| |
3151 |
||
3152 |
FileOutNameSpaceQuerySignal answer:true |
|
3153 |
do:[ |
|
3154 |
aStream := self changesStream. |
|
3155 |
aStream notNil ifTrue:[ |
|
3156 |
[ |
|
3157 |
FileStream writeErrorSignal handle:[:ex | |
|
3158 |
self warn:('Could not update the changes-file\\' , ex description) withCRs. |
|
3159 |
ex return |
|
3160 |
] do:[ |
|
3161 |
|didWarn| |
|
3162 |
||
3163 |
didWarn := false. |
|
3164 |
EncodingError handle:[:ex | |
|
3165 |
didWarn ifFalse:[ |
|
3166 |
self warn:(c'The changeFile cannot correctly represent this change.\n(ChangeFile is not utf8 encoded.)\nPlease start with a fresh changeFile.'). |
|
3167 |
didWarn := true. |
|
3168 |
]. |
|
3169 |
ex proceedWith:(ex defaultValue). |
|
3170 |
] do:[ |
|
3171 |
doStampIt ifTrue:[ |
|
3172 |
self addChangeTimeStampTo:aStream |
|
3173 |
]. |
|
3174 |
aBlock value:aStream. |
|
3175 |
aStream cr. |
|
3176 |
]. |
|
3177 |
]. |
|
3178 |
] ensure:[ |
|
3179 |
aStream close |
|
3180 |
] |
|
3181 |
] |
|
3182 |
] |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3183 |
] |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3184 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3185 |
"Modified: 22.3.1997 / 17:12:40 / cg" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3186 |
"Created: 2.4.1997 / 17:33:09 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3187 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3188 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3189 |
writingChangeWithTimeStamp:stampIt perform:aSelector with:anArgument |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3190 |
"{ Pragma: +optSpace }" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3191 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3192 |
self writingChangeWithTimeStamp:stampIt do:[:stream | |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3193 |
self perform:aSelector with:anArgument with:stream. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3194 |
] |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3195 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3196 |
"Created: 2.4.1997 / 17:33:16 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3197 |
! ! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3198 |
|
7258 | 3199 |
!ClassDescription methodsFor:'private-helpers'! |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3200 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3201 |
addAllCategoriesTo:aCollection |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3202 |
"helper - add categories and all superclasses categories |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3203 |
to the argument, aCollection" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3204 |
|
6394
492964c0fd9b
instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents:
6393
diff
changeset
|
3205 |
|superclass| |
492964c0fd9b
instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents:
6393
diff
changeset
|
3206 |
|
492964c0fd9b
instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents:
6393
diff
changeset
|
3207 |
superclass := self superclass. |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3208 |
(superclass notNil) ifTrue:[ |
8551 | 3209 |
superclass addAllCategoriesTo:aCollection |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3210 |
]. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3211 |
self addCategoriesTo:aCollection |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3212 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3213 |
"Created: 1.4.1997 / 23:52:27 / stefan" |
620 | 3214 |
! |
3215 |
||
22028 | 3216 |
addAllPrivateClassesTo:aCollection |
3217 |
"add all of my private classes to aCollection" |
|
3218 |
||
3219 |
self privateClassesDo:[:aPrivateClass | |
|
3220 |
aCollection add:aPrivateClass. |
|
3221 |
aPrivateClass addAllPrivateClassesTo:aCollection |
|
3222 |
]. |
|
3223 |
! |
|
3224 |
||
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3225 |
addCategoriesTo:aCollection |
7163 | 3226 |
"helper - add categories to the argument, aCollection. |
3227 |
aCollection should be a set." |
|
3228 |
||
21978 | 3229 |
aCollection addAll:(self methodCategories). |
7163 | 3230 |
|
3231 |
"/ no need for tuning; |
|
3232 |
"/ its only used in the browsers new-protocol function. |
|
3233 |
||
3234 |
"/ |prevCat| |
|
3235 |
"/ |
|
3236 |
"/ self methodDictionary do:[:aMethod | |
|
3237 |
"/ |cat| |
|
3238 |
"/ |
|
3239 |
"/ cat := aMethod category. |
|
3240 |
"/ cat ~~ prevCat ifTrue:[ |
|
3241 |
"/ aCollection add:cat. |
|
3242 |
"/ prevCat := cat. |
|
3243 |
"/ ]. |
|
3244 |
"/ ] |
|
21978 | 3245 |
|
3246 |
"Modified: / 05-07-2017 / 10:51:13 / cg" |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3247 |
! ! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3248 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3249 |
!ClassDescription methodsFor:'protocol printOut'! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3250 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3251 |
printOutCategoryProtocol:aCategory on:aPrintStream |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3252 |
"{ Pragma: +optSpace }" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3253 |
|
16281 | 3254 |
|interestingMethods sortedSelectors| |
3255 |
||
3256 |
interestingMethods := (self methodsInCategory:aCategory) asOrderedCollection. |
|
3257 |
sortedSelectors := interestingMethods collect:[:m | self selectorAtMethod:m]. |
|
3258 |
sortedSelectors sortWith:interestingMethods. |
|
11697 | 3259 |
interestingMethods notEmptyOrNil ifTrue:[ |
3260 |
aPrintStream italic. |
|
3261 |
aPrintStream nextPutAll:aCategory. |
|
3262 |
aPrintStream normal. |
|
3263 |
aPrintStream cr; cr. |
|
3264 |
interestingMethods do:[:aMethod | |
|
3265 |
self printOutMethodProtocol:aMethod on:aPrintStream. |
|
3266 |
aPrintStream cr; cr |
|
3267 |
]. |
|
3268 |
aPrintStream cr |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3269 |
] |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3270 |
|
16281 | 3271 |
" |
3272 |
ClassDescription printOutCategoryProtocol:'queries' on:Transcript |
|
3273 |
" |
|
3274 |
||
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3275 |
"Modified: 20.4.1996 / 18:20:26 / cg" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3276 |
"Modified: 12.6.1996 / 11:48:46 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3277 |
"Created: 2.4.1997 / 01:10:40 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3278 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3279 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3280 |
printOutMethodProtocol:aMethod on:aPrintStream |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3281 |
"{ Pragma: +optSpace }" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3282 |
|
22366 | 3283 |
"given the source in aString, print the method's message specification |
3284 |
and any method comments - without source. |
|
3285 |
Used to generate documentation pages" |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3286 |
|
7610 | 3287 |
|source comment| |
3288 |
||
14617 | 3289 |
source := aMethod source. |
3290 |
source isEmptyOrNil ifTrue:[^self]. |
|
3291 |
source := source asStringCollection. |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3292 |
aPrintStream bold. |
7610 | 3293 |
aPrintStream nextPutLine:(source at:1). |
3294 |
(source size >= 2) ifTrue:[ |
|
14617 | 3295 |
(comment := aMethod comment) notNil ifTrue:[ |
3296 |
aPrintStream italic. |
|
3297 |
aPrintStream spaces:((source at:2) indexOfNonSeparatorStartingAt:1). |
|
3298 |
aPrintStream nextPutLine:comment. |
|
3299 |
] |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3300 |
]. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3301 |
aPrintStream normal |
620 | 3302 |
|
3303 |
" |
|
7610 | 3304 |
Float printOutProtocolOn:Stdout |
3305 |
Float printOutMethodProtocol:(Float compiledMethodAt:#coerce:) on:Transcript |
|
620 | 3306 |
" |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3307 |
|
22366 | 3308 |
"Modified: / 09-11-1996 / 00:13:54 / cg" |
3309 |
"Created: / 02-04-1997 / 01:11:00 / stefan" |
|
3310 |
"Modified (comment): / 21-11-2017 / 12:59:27 / cg" |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3311 |
! ! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3312 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3313 |
!ClassDescription methodsFor:'queries'! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3314 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3315 |
allCategories |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3316 |
"Return a collection of all method-categories known in class |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3317 |
and all superclasses. This does NOT include the metaclass categories. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3318 |
The returned collection is not sorted by any order." |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3319 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3320 |
|coll| |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3321 |
|
6930 | 3322 |
coll := Set new. |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3323 |
self addAllCategoriesTo:coll. |
6930 | 3324 |
^ coll asOrderedCollection |
620 | 3325 |
|
3326 |
" |
|
8551 | 3327 |
Point categories |
3328 |
Point allCategories |
|
3329 |
||
3330 |
Point class categories |
|
3331 |
Point class allCategories |
|
620 | 3332 |
" |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3333 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3334 |
"Modified: 21.3.1996 / 16:28:57 / cg" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3335 |
"Created: 1.4.1997 / 15:57:41 / stefan" |
620 | 3336 |
! |
3337 |
||
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3338 |
categories |
7163 | 3339 |
"Return a collection of the method-categories known in the receiver class. |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3340 |
This does NOT include the metaclasses categories or the superclass categories. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3341 |
The returned collection is not sorted by any order." |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3342 |
|
20515 | 3343 |
^ self methodCategories |
620 | 3344 |
|
3345 |
" |
|
8551 | 3346 |
Point categories |
3347 |
Point class categories |
|
620 | 3348 |
" |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3349 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3350 |
"Modified: 16.4.1996 / 18:06:11 / cg" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3351 |
"Modified: 12.6.1996 / 11:25:59 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3352 |
"Created: 1.4.1997 / 15:57:18 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3353 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3354 |
|
15379 | 3355 |
commentOrDocumentationString |
17416 | 3356 |
"return either the classes documentation-method's comment |
3357 |
or its plain comment or nil" |
|
15379 | 3358 |
|
15380 | 3359 |
|cls m s| |
15379 | 3360 |
|
3361 |
cls := self theNonMetaclass. |
|
3362 |
m := cls theMetaclass compiledMethodAt:#documentation. |
|
3363 |
m notNil ifTrue:[ |
|
15754 | 3364 |
"/ try documentation method's comment |
15379 | 3365 |
s := m comment. |
3366 |
] ifFalse:[ |
|
15754 | 3367 |
"try classes comment" |
15379 | 3368 |
s := cls comment. |
3369 |
s isString ifTrue:[ |
|
3370 |
s isEmpty ifTrue:[ |
|
3371 |
s := nil |
|
3372 |
] ifFalse:[ |
|
16760 | 3373 |
s := s copyReplaceAll:$" with:$' ifNone:s. |
15379 | 3374 |
s size > 80 ifTrue:[ |
3375 |
s := s asCollectionOfSubstringsSeparatedBy:$.. |
|
3376 |
s := s asStringCollection. |
|
3377 |
s := s collect:[:each | (each startsWith:Character space) ifTrue:[ |
|
3378 |
each copyFrom:2 |
|
3379 |
] ifFalse:[ |
|
3380 |
each |
|
3381 |
] |
|
3382 |
]. |
|
3383 |
s := s asStringWith:('.' , Character cr). |
|
3384 |
]. |
|
3385 |
] |
|
3386 |
] ifFalse:[ |
|
3387 |
"/ class redefines comment ? |
|
3388 |
s := nil |
|
3389 |
]. |
|
3390 |
]. |
|
15755 | 3391 |
s isEmptyOrNil ifTrue:[^ s]. |
15754 | 3392 |
^ s withTabsExpanded |
15379 | 3393 |
|
3394 |
" |
|
3395 |
Array commentOrDocumentationString |
|
3396 |
" |
|
3397 |
! |
|
3398 |
||
11059 | 3399 |
definesInstanceVariable:aString |
3400 |
(self directlyDefinesInstanceVariable:aString) ifTrue: [^ true]. |
|
3401 |
^ superclass notNil and:[superclass definesInstanceVariable:aString] |
|
3402 |
! |
|
3403 |
||
3404 |
directlyDefinesInstanceVariable:aString |
|
3405 |
^ self instanceVariableNames includes:aString |
|
3406 |
! |
|
3407 |
||
8551 | 3408 |
isObsolete |
3409 |
"return true, if the receiver is obsolete |
|
3410 |
(i.e. has been replaced by a different class or was removed, |
|
22442 | 3411 |
but is still referenced by instances)" |
5554 | 3412 |
|
3413 |
|cat| |
|
3414 |
||
3415 |
cat := self category. |
|
3416 |
||
8551 | 3417 |
^ cat = 'obsolete' |
5554 | 3418 |
or:[cat = 'removed' |
3419 |
or:[cat = '* removed *' |
|
3420 |
or:[cat = '* obsolete *']]] |
|
3421 |
||
3422 |
"Modified: 10.9.1996 / 14:02:07 / cg" |
|
3423 |
"Modified: 1.4.1997 / 15:49:49 / stefan" |
|
3424 |
! |
|
3425 |
||
20515 | 3426 |
methodCategories |
3427 |
"Return a collection of the method-categories known in the receiver class. |
|
3428 |
This does NOT include the metaclasses categories or the superclass categories. |
|
3429 |
The returned collection is not sorted by any order." |
|
3430 |
||
3431 |
|newList| |
|
3432 |
||
3433 |
newList := Set new. |
|
3434 |
self methodDictionary do:[:aMethod | |
|
3435 |
newList add:(aMethod category ? '* no category *') |
|
3436 |
]. |
|
3437 |
^ newList |
|
3438 |
||
3439 |
" |
|
3440 |
Point methodCategories |
|
3441 |
Point class methodCategories |
|
3442 |
" |
|
3443 |
||
3444 |
"Modified: 16.4.1996 / 18:06:11 / cg" |
|
3445 |
"Modified: 12.6.1996 / 11:25:59 / stefan" |
|
3446 |
"Created: 1.4.1997 / 15:57:18 / stefan" |
|
3447 |
! |
|
3448 |
||
13994 | 3449 |
methodsInCategory:aCategory |
3450 |
"helper for fileOut: |
|
3451 |
return an unsorted collection of methods from a given category" |
|
3452 |
||
3453 |
^ self methodsInCategory:aCategory forWhich:[:m | true ] |
|
3454 |
||
3455 |
" |
|
3456 |
ClassDescription methodsInCategory:'queries' |
|
3457 |
" |
|
3458 |
||
3459 |
"Created: / 31-01-2012 / 13:53:07 / cg" |
|
3460 |
! |
|
3461 |
||
3462 |
methodsInCategory:aCategory forWhich:methodFilter |
|
3463 |
"helper for fileOut: return an unsorted collection of methods from a |
|
3464 |
given category, for which a filterblock evaluates to true" |
|
3465 |
||
3466 |
|interestingMethods| |
|
3467 |
||
3468 |
interestingMethods := OrderedCollection new. |
|
3469 |
self methodsDo:[:aMethod | |
|
3470 |
(methodFilter isNil |
|
3471 |
or:[methodFilter value:aMethod]) ifTrue:[ |
|
3472 |
(aCategory = aMethod category) ifTrue:[ |
|
3473 |
interestingMethods add:aMethod. |
|
3474 |
] |
|
3475 |
] |
|
3476 |
]. |
|
3477 |
^ interestingMethods |
|
3478 |
||
3479 |
" |
|
3480 |
ClassDescription methodsInCategory:'queries' forWhich:[:m | m selector startsWith:'w'] |
|
3481 |
" |
|
3482 |
||
3483 |
"Modified (comment): / 31-01-2012 / 13:57:23 / cg" |
|
3484 |
! |
|
3485 |
||
18458 | 3486 |
privateClasses |
3487 |
^ #() |
|
3488 |
! |
|
3489 |
||
3621
d98d21976dec
had to move #sourceCodeForMethod up.
Claus Gittinger <cg@exept.de>
parents:
3616
diff
changeset
|
3490 |
sourceCodeForMethod:aMethod at:aSelector |
d98d21976dec
had to move #sourceCodeForMethod up.
Claus Gittinger <cg@exept.de>
parents:
3616
diff
changeset
|
3491 |
^ aMethod source |
d98d21976dec
had to move #sourceCodeForMethod up.
Claus Gittinger <cg@exept.de>
parents:
3616
diff
changeset
|
3492 |
|
d98d21976dec
had to move #sourceCodeForMethod up.
Claus Gittinger <cg@exept.de>
parents:
3616
diff
changeset
|
3493 |
"Created: / 19.6.1998 / 02:28:09 / cg" |
d98d21976dec
had to move #sourceCodeForMethod up.
Claus Gittinger <cg@exept.de>
parents:
3616
diff
changeset
|
3494 |
! |
d98d21976dec
had to move #sourceCodeForMethod up.
Claus Gittinger <cg@exept.de>
parents:
3616
diff
changeset
|
3495 |
|
7658
b009bc99dd47
oops - Metaclass needs topNameSpace
Claus Gittinger <cg@exept.de>
parents:
7657
diff
changeset
|
3496 |
topNameSpace |
b009bc99dd47
oops - Metaclass needs topNameSpace
Claus Gittinger <cg@exept.de>
parents:
7657
diff
changeset
|
3497 |
"return the nameSpace of my topOwningClass (if private) or my own nameSpace." |
b009bc99dd47
oops - Metaclass needs topNameSpace
Claus Gittinger <cg@exept.de>
parents:
7657
diff
changeset
|
3498 |
|
15406 | 3499 |
|ns| |
3500 |
||
7658
b009bc99dd47
oops - Metaclass needs topNameSpace
Claus Gittinger <cg@exept.de>
parents:
7657
diff
changeset
|
3501 |
self isPrivate ifTrue:[^ self topOwningClass topNameSpace]. |
22814 | 3502 |
|
15406 | 3503 |
ns := self nameSpace. |
15555 | 3504 |
ns isNil ifTrue:[ |
3505 |
"/ probably an unbound class |
|
15406 | 3506 |
ns := Smalltalk. "/ What a KLUDGE |
15555 | 3507 |
] ifFalse:[ |
3508 |
ns isNameSpace ifFalse:[ |
|
18207 | 3509 |
"detect the problem, that a class has the same name as a nameSpace" |
15863 | 3510 |
self breakPoint:#cg. |
15555 | 3511 |
ns := Smalltalk. "/ What a KLUDGE |
3512 |
] |
|
15406 | 3513 |
]. |
3514 |
^ ns. |
|
7658
b009bc99dd47
oops - Metaclass needs topNameSpace
Claus Gittinger <cg@exept.de>
parents:
7657
diff
changeset
|
3515 |
! |
b009bc99dd47
oops - Metaclass needs topNameSpace
Claus Gittinger <cg@exept.de>
parents:
7657
diff
changeset
|
3516 |
|
3616
c2f0a1519163
added #whichCategoryIncludesSelector
Claus Gittinger <cg@exept.de>
parents:
3606
diff
changeset
|
3517 |
whichCategoryIncludesSelector:aSelector |
c2f0a1519163
added #whichCategoryIncludesSelector
Claus Gittinger <cg@exept.de>
parents:
3606
diff
changeset
|
3518 |
"return the category under which the method for aSelector is |
c2f0a1519163
added #whichCategoryIncludesSelector
Claus Gittinger <cg@exept.de>
parents:
3606
diff
changeset
|
3519 |
classified" |
c2f0a1519163
added #whichCategoryIncludesSelector
Claus Gittinger <cg@exept.de>
parents:
3606
diff
changeset
|
3520 |
|
c2f0a1519163
added #whichCategoryIncludesSelector
Claus Gittinger <cg@exept.de>
parents:
3606
diff
changeset
|
3521 |
^ (self compiledMethodAt:aSelector) category |
c2f0a1519163
added #whichCategoryIncludesSelector
Claus Gittinger <cg@exept.de>
parents:
3606
diff
changeset
|
3522 |
|
c2f0a1519163
added #whichCategoryIncludesSelector
Claus Gittinger <cg@exept.de>
parents:
3606
diff
changeset
|
3523 |
"Created: / 19.6.1998 / 00:25:48 / cg" |
c2f0a1519163
added #whichCategoryIncludesSelector
Claus Gittinger <cg@exept.de>
parents:
3606
diff
changeset
|
3524 |
"Modified: / 19.6.1998 / 01:00:07 / cg" |
c2f0a1519163
added #whichCategoryIncludesSelector
Claus Gittinger <cg@exept.de>
parents:
3606
diff
changeset
|
3525 |
! |
c2f0a1519163
added #whichCategoryIncludesSelector
Claus Gittinger <cg@exept.de>
parents:
3606
diff
changeset
|
3526 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3527 |
whichClassDefinesInstVar:aVariableName |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3528 |
"return the class which defines the instance variable |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3529 |
named aVariableName. This method should not be used for |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3530 |
repeated searches (i.e. in the compiler/parser), since it creates |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3531 |
many throw away intermediate objects." |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3532 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3533 |
|cls| |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3534 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3535 |
cls := self. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3536 |
[cls notNil] whileTrue:[ |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3537 |
(cls instVarNames includes:aVariableName) ifTrue:[ ^ cls]. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3538 |
cls := cls superclass |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3539 |
]. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3540 |
^ nil |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3541 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3542 |
" |
8551 | 3543 |
StandardSystemView whichClassDefinesInstVar:'label' |
3544 |
StandardSystemView whichClassDefinesInstVar:'paint' |
|
3545 |
StandardSystemView whichClassDefinesInstVar:'foo' |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3546 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3547 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
3548 |
"Created: 2.4.1997 / 01:12:27 / stefan" |
2701 | 3549 |
! |
3550 |
||
22811 | 3551 |
whichPoolDefinesPoolVar:aVariableName |
3552 |
"return the shared which defines the class variable named aVariableName or nil." |
|
3553 |
||
3554 |
self sharedPools do:[:eachPool | |
|
3555 |
(eachPool classVariableNames includes:aVariableName) ifTrue:[ ^ eachPool]. |
|
3556 |
]. |
|
3557 |
^ nil |
|
3558 |
||
3559 |
" |
|
3560 |
ZipArchiveConstants classVariableNames |
|
3561 |
ZipArchive sharedPools |
|
3562 |
ZipArchive whichPoolDefinesPoolVar:'ECREC_SIZE' |
|
3563 |
||
3564 |
ZipArchive class sharedPools |
|
3565 |
" |
|
3566 |
! |
|
3567 |
||
2701 | 3568 |
whichSelectorsAccess:instVarName |
3569 |
"return a collection of selectors for methods which access |
|
3570 |
an instance variable" |
|
3571 |
||
3572 |
|set| |
|
3573 |
||
10183 | 3574 |
(self allInstVarNames includes:instVarName) ifFalse:[ |
3575 |
^ #() |
|
6229
e79f4aeff134
dont search in whichSelectorsAccess,
Claus Gittinger <cg@exept.de>
parents:
6216
diff
changeset
|
3576 |
]. |
e79f4aeff134
dont search in whichSelectorsAccess,
Claus Gittinger <cg@exept.de>
parents:
6216
diff
changeset
|
3577 |
|
2701 | 3578 |
set := IdentitySet new. |
5369 | 3579 |
self selectorsAndMethodsDo:[:sel :mthd | |
14240
daae10e423d8
changed: #whichSelectorsAccess:
Claus Gittinger <cg@exept.de>
parents:
14096
diff
changeset
|
3580 |
(mthd accessesInstVar:instVarName) ifTrue:[ |
10183 | 3581 |
set add:sel |
3582 |
] |
|
2701 | 3583 |
]. |
3584 |
^ set. |
|
3585 |
||
10183 | 3586 |
"Created: / 19-06-1997 / 17:51:50 / cg" |
14240
daae10e423d8
changed: #whichSelectorsAccess:
Claus Gittinger <cg@exept.de>
parents:
14096
diff
changeset
|
3587 |
"Modified: / 23-07-2012 / 11:17:57 / cg" |
620 | 3588 |
! ! |
3589 |
||
3590 |
!ClassDescription methodsFor:'special accessing'! |
|
3591 |
||
16018 | 3592 |
setInstVarNames:aCollectionOfStrings |
16017 | 3593 |
"set the instance variable names from a collection of strings. |
3594 |
No recompilation or updates are done and no changeList records are written. |
|
3595 |
This is NOT for general use." |
|
3596 |
||
19271 | 3597 |
instvars := aCollectionOfStrings collect:[:varName| varName asSymbol] as:Array. |
16017 | 3598 |
|
3599 |
" |
|
3600 |
Point instVarNames |
|
3601 |
SortedCollection instVarNames |
|
3602 |
SortedCollection allInstVarNames |
|
3603 |
" |
|
3604 |
! |
|
3605 |
||
19271 | 3606 |
setInstVarNamesArray:anArrayOfSymbols |
3607 |
"set the instance variable names from an Array of Symbols. |
|
3608 |
No recompilation or updates are done and no changeList records are written. |
|
3609 |
This is NOT for general use." |
|
3610 |
||
3611 |
instvars := anArrayOfSymbols. |
|
3612 |
! |
|
3613 |
||
620 | 3614 |
setInstanceVariableString:aString |
16017 | 3615 |
"set the classes instvarnames string. |
3616 |
No recompilation or updates are done and no changeList records are written. |
|
620 | 3617 |
This is NOT for general use." |
3618 |
||
3619 |
instvars := aString. |
|
3620 |
! ! |
|
3621 |
||
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3622 |
!ClassDescription methodsFor:'subclass creation'! |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3623 |
|
23686 | 3624 |
subclass:nameSymbol |
3625 |
"create a new class as a subclass of an existing class (the receiver). |
|
3626 |
The subclass will have indexed variables if the receiving-class has." |
|
3627 |
||
3628 |
^ self |
|
3629 |
subclass:nameSymbol |
|
3630 |
instanceVariableNames:'' |
|
3631 |
classVariableNames:'' |
|
3632 |
poolDictionaries:'' |
|
3633 |
category:'* as yet unspecified *' |
|
3634 |
||
3635 |
"Created: / 09-02-2019 / 15:05:15 / Claus Gittinger" |
|
3636 |
! |
|
3637 |
||
3638 |
subclass:nameSymbol instanceVariableNames:instVarNameString |
|
3639 |
"create a new class as a subclass of an existing class (the receiver). |
|
3640 |
The subclass will have indexed variables if the receiving-class has." |
|
3641 |
||
3642 |
^ self |
|
3643 |
subclass:nameSymbol |
|
3644 |
instanceVariableNames:instVarNameString |
|
3645 |
classVariableNames:'' |
|
3646 |
poolDictionaries:'' |
|
3647 |
category:'* as yet unspecified *' |
|
3648 |
||
3649 |
"Created: / 09-02-2019 / 15:05:36 / Claus Gittinger" |
|
3650 |
! |
|
3651 |
||
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3652 |
subclass:nameSymbol instanceVariableNames:instVarNameString classVariableNames:classVarString poolDictionaries:pool category:cat |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3653 |
"create a new class as a subclass of an existing class (the receiver). |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3654 |
The subclass will have indexed variables if the receiving-class has." |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3655 |
|
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3656 |
self isVariable ifFalse:[ |
8551 | 3657 |
^ self class |
3658 |
name:nameSymbol |
|
3659 |
inEnvironment:(Class nameSpaceQuerySignal query) |
|
3660 |
subclassOf:self |
|
3661 |
instanceVariableNames:instVarNameString |
|
3662 |
variable:false |
|
3663 |
words:true |
|
3664 |
pointers:true |
|
3665 |
classVariableNames:classVarString |
|
3666 |
poolDictionaries:pool |
|
3667 |
category:cat |
|
3668 |
comment:nil |
|
3669 |
changed:true |
|
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3670 |
]. |
8551 | 3671 |
^ self |
3672 |
perform:(self definitionSelector) |
|
3673 |
withArguments:(Array with:nameSymbol |
|
3674 |
with:instVarNameString |
|
3675 |
with:classVarString |
|
3676 |
with:pool |
|
3677 |
with:cat). |
|
4056
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
3678 |
|
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
3679 |
"Modified: / 8.3.1997 / 00:41:08 / cg" |
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
3680 |
"Modified: / 18.3.1999 / 18:18:25 / stefan" |
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3681 |
! |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3682 |
|
6817 | 3683 |
subclass:nameSymbol instanceVariableNames:instVarNameString classVariableNames:classVarString poolDictionaries:pool category:cat classInstanceVariableNames:classInstanceVariableNames |
3684 |
"create a new class as a subclass of an existing class (the receiver). |
|
3685 |
The subclass will have indexed variables if the receiving-class has." |
|
3686 |
||
3687 |
^ self class |
|
8551 | 3688 |
name:nameSymbol |
3689 |
inEnvironment:(Class nameSpaceQuerySignal query) |
|
3690 |
subclassOf:self |
|
3691 |
instanceVariableNames:instVarNameString |
|
3692 |
variable:false |
|
3693 |
words:true |
|
3694 |
pointers:true |
|
3695 |
classVariableNames:classVarString |
|
3696 |
poolDictionaries:pool |
|
3697 |
category:cat |
|
3698 |
comment:nil |
|
3699 |
changed:true |
|
3700 |
classInstanceVariableNames:classInstanceVariableNames |
|
6817 | 3701 |
! |
3702 |
||
2365
407104ea10db
additional entry, passing the environment
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
3703 |
subclass:nameSymbol instanceVariableNames:instVarNameString classVariableNames:classVarString poolDictionaries:pool category:cat inEnvironment:aNameSpace |
407104ea10db
additional entry, passing the environment
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
3704 |
"create a new class as a subclass of an existing class (the receiver). |
407104ea10db
additional entry, passing the environment
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
3705 |
The subclass will have indexed variables if the receiving-class has." |
407104ea10db
additional entry, passing the environment
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
3706 |
|
3977
57eb1e1f6dd0
avoid return from unwind-block
Claus Gittinger <cg@exept.de>
parents:
3965
diff
changeset
|
3707 |
|rslt| |
57eb1e1f6dd0
avoid return from unwind-block
Claus Gittinger <cg@exept.de>
parents:
3965
diff
changeset
|
3708 |
|
2365
407104ea10db
additional entry, passing the environment
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
3709 |
self isVariable ifTrue:[ |
8551 | 3710 |
Class nameSpaceQuerySignal answer:aNameSpace |
3711 |
do:[ |
|
3712 |
rslt := self |
|
3713 |
subclass:nameSymbol |
|
3714 |
instanceVariableNames:instVarNameString |
|
3715 |
classVariableNames:classVarString |
|
3716 |
poolDictionaries:pool |
|
3717 |
category:cat |
|
3718 |
]. |
|
3719 |
^ rslt |
|
2365
407104ea10db
additional entry, passing the environment
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
3720 |
]. |
407104ea10db
additional entry, passing the environment
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
3721 |
^ self class |
8551 | 3722 |
name:nameSymbol |
3723 |
inEnvironment:aNameSpace |
|
3724 |
subclassOf:self |
|
3725 |
instanceVariableNames:instVarNameString |
|
3726 |
variable:false |
|
3727 |
words:true |
|
3728 |
pointers:true |
|
3729 |
classVariableNames:classVarString |
|
3730 |
poolDictionaries:pool |
|
3731 |
category:cat |
|
3732 |
comment:nil |
|
3733 |
changed:true |
|
2365
407104ea10db
additional entry, passing the environment
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
3734 |
|
407104ea10db
additional entry, passing the environment
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
3735 |
"Created: 8.2.1997 / 19:41:44 / cg" |
2893 | 3736 |
"Modified: 31.8.1997 / 07:48:14 / cg" |
2365
407104ea10db
additional entry, passing the environment
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
3737 |
! |
407104ea10db
additional entry, passing the environment
Claus Gittinger <cg@exept.de>
parents:
1912
diff
changeset
|
3738 |
|
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3739 |
variableByteSubclass:nameSymbol instanceVariableNames:instVarNameString classVariableNames:classVarString poolDictionaries:pool category:cat |
8551 | 3740 |
"create a new class as a subclass of an existing class (the receiver) |
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3741 |
in which the subclass has indexable byte-sized nonpointer variables" |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3742 |
|
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3743 |
self isVariable ifTrue:[ |
11894 | 3744 |
self isBytes ifFalse:[ |
3745 |
^ ClassBuildError raiseErrorString: |
|
17639 | 3746 |
('Cannot make variable byte subclass "%1" of variable non-byte class "%2"' |
3747 |
bindWith:nameSymbol with:self name) |
|
11894 | 3748 |
]. |
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3749 |
]. |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3750 |
|
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3751 |
^ self class |
11894 | 3752 |
name:nameSymbol |
3753 |
inEnvironment:(Class nameSpaceQuerySignal query) |
|
3754 |
subclassOf:self |
|
3755 |
instanceVariableNames:instVarNameString |
|
3756 |
variable:true |
|
3757 |
words:false |
|
3758 |
pointers:false |
|
3759 |
classVariableNames:classVarString |
|
3760 |
poolDictionaries:pool |
|
3761 |
category:cat |
|
3762 |
comment:nil |
|
3763 |
changed:true |
|
4056
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
3764 |
|
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
3765 |
"Created: / 12.10.1996 / 19:18:18 / cg" |
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
3766 |
"Modified: / 6.11.1996 / 22:48:18 / cg" |
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
3767 |
"Modified: / 18.3.1999 / 18:18:38 / stefan" |
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3768 |
! |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3769 |
|
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3770 |
variableDoubleSubclass:nameSymbol instanceVariableNames:instVarNameString classVariableNames:classVarString poolDictionaries:pool category:cat |
8551 | 3771 |
"create a new class as a subclass of an existing class (the receiver) |
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3772 |
in which the subclass has indexable double-sized nonpointer variables" |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3773 |
|
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3774 |
self isVariable ifTrue:[ |
11894 | 3775 |
self isDoubles ifFalse:[ |
3776 |
^ ClassBuildError raiseErrorString: |
|
17639 | 3777 |
('Cannot make variable double subclass "%1" of variable non-double class "%2"' |
3778 |
bindWith:nameSymbol with:self name) |
|
11894 | 3779 |
]. |
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3780 |
]. |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3781 |
|
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3782 |
^ self class |
11894 | 3783 |
name:nameSymbol |
3784 |
inEnvironment:(Class nameSpaceQuerySignal query) |
|
3785 |
subclassOf:self |
|
3786 |
instanceVariableNames:instVarNameString |
|
3787 |
variable:#double |
|
3788 |
words:false |
|
3789 |
pointers:false |
|
3790 |
classVariableNames:classVarString |
|
3791 |
poolDictionaries:pool |
|
3792 |
category:cat |
|
3793 |
comment:nil |
|
3794 |
changed:true |
|
4056
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
3795 |
|
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
3796 |
"Created: / 12.10.1996 / 19:18:21 / cg" |
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
3797 |
"Modified: / 6.11.1996 / 22:48:22 / cg" |
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
3798 |
"Modified: / 18.3.1999 / 18:18:54 / stefan" |
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3799 |
! |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3800 |
|
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3801 |
variableFloatSubclass:nameSymbol instanceVariableNames:instVarNameString classVariableNames:classVarString poolDictionaries:pool category:cat |
8551 | 3802 |
"create a new class as a subclass of an existing class (the receiver) |
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3803 |
in which the subclass has indexable float-sized nonpointer variables" |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3804 |
|
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3805 |
self isVariable ifTrue:[ |
11894 | 3806 |
self isFloats ifFalse:[ |
3807 |
^ ClassBuildError raiseErrorString: |
|
17639 | 3808 |
('Cannot make variable float subclass "%1" of variable non-float class "%2"' |
3809 |
bindWith:nameSymbol with:self name) |
|
11894 | 3810 |
]. |
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3811 |
]. |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3812 |
|
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3813 |
^ self class |
11894 | 3814 |
name:nameSymbol |
3815 |
inEnvironment:(Class nameSpaceQuerySignal query) |
|
3816 |
subclassOf:self |
|
3817 |
instanceVariableNames:instVarNameString |
|
3818 |
variable:#float |
|
3819 |
words:false |
|
3820 |
pointers:false |
|
3821 |
classVariableNames:classVarString |
|
3822 |
poolDictionaries:pool |
|
3823 |
category:cat |
|
3824 |
comment:nil |
|
3825 |
changed:true |
|
4056
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
3826 |
|
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
3827 |
"Created: / 12.10.1996 / 19:18:24 / cg" |
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
3828 |
"Modified: / 6.11.1996 / 22:48:26 / cg" |
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
3829 |
"Modified: / 18.3.1999 / 18:19:02 / stefan" |
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3830 |
! |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3831 |
|
3965
cef66fdfff9e
allow suppress of dialog when filed-in classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3918
diff
changeset
|
3832 |
variableLongLongSubclass:nameSymbol instanceVariableNames:instVarNameString classVariableNames:classVarString poolDictionaries:pool category:cat |
8551 | 3833 |
"create a new class as a subclass of an existing class (the receiver) |
3965
cef66fdfff9e
allow suppress of dialog when filed-in classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3918
diff
changeset
|
3834 |
in which the subclass has indexable unsigned long-long-sized nonpointer variables" |
cef66fdfff9e
allow suppress of dialog when filed-in classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3918
diff
changeset
|
3835 |
|
cef66fdfff9e
allow suppress of dialog when filed-in classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3918
diff
changeset
|
3836 |
self isVariable ifTrue:[ |
11894 | 3837 |
self isLongLongs ifFalse:[ |
3838 |
^ ClassBuildError raiseErrorString: |
|
17639 | 3839 |
('Cannot make variable long-long subclass "%1" of variable non-long-long class "%2"' |
3840 |
bindWith:nameSymbol with:self name) |
|
11894 | 3841 |
]. |
3965
cef66fdfff9e
allow suppress of dialog when filed-in classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3918
diff
changeset
|
3842 |
]. |
cef66fdfff9e
allow suppress of dialog when filed-in classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3918
diff
changeset
|
3843 |
|
cef66fdfff9e
allow suppress of dialog when filed-in classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3918
diff
changeset
|
3844 |
^ self class |
11894 | 3845 |
name:nameSymbol |
3846 |
inEnvironment:(Class nameSpaceQuerySignal query) |
|
3847 |
subclassOf:self |
|
3848 |
instanceVariableNames:instVarNameString |
|
3849 |
variable:#longLong |
|
3850 |
words:false |
|
3851 |
pointers:false |
|
3852 |
classVariableNames:classVarString |
|
3853 |
poolDictionaries:pool |
|
3854 |
category:cat |
|
3855 |
comment:nil |
|
3856 |
changed:true |
|
4056
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
3857 |
|
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
3858 |
"Modified: / 18.3.1999 / 18:19:17 / stefan" |
3965
cef66fdfff9e
allow suppress of dialog when filed-in classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3918
diff
changeset
|
3859 |
! |
cef66fdfff9e
allow suppress of dialog when filed-in classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3918
diff
changeset
|
3860 |
|
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3861 |
variableLongSubclass:nameSymbol instanceVariableNames:instVarNameString classVariableNames:classVarString poolDictionaries:pool category:cat |
8551 | 3862 |
"create a new class as a subclass of an existing class (the receiver) |
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3863 |
in which the subclass has indexable long-sized nonpointer variables" |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3864 |
|
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3865 |
self isVariable ifTrue:[ |
11894 | 3866 |
self isLongs ifFalse:[ |
3867 |
self isBytes ifFalse:[ |
|
3868 |
^ ClassBuildError raiseErrorString: |
|
17639 | 3869 |
('Cannot make variable long subclass "%1" of variable non-long class "%2"' |
3870 |
bindWith:nameSymbol with:self name) |
|
11894 | 3871 |
]. |
3872 |
]. |
|
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3873 |
]. |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3874 |
|
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3875 |
^ self class |
11894 | 3876 |
name:nameSymbol |
3877 |
inEnvironment:(Class nameSpaceQuerySignal query) |
|
3878 |
subclassOf:self |
|
3879 |
instanceVariableNames:instVarNameString |
|
3880 |
variable:#long |
|
3881 |
words:false |
|
3882 |
pointers:false |
|
3883 |
classVariableNames:classVarString |
|
3884 |
poolDictionaries:pool |
|
3885 |
category:cat |
|
3886 |
comment:nil |
|
3887 |
changed:true |
|
4056
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
3888 |
|
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
3889 |
"Created: / 12.10.1996 / 19:18:27 / cg" |
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
3890 |
"Modified: / 6.11.1996 / 22:48:29 / cg" |
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
3891 |
"Modified: / 18.3.1999 / 18:19:28 / stefan" |
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3892 |
! |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3893 |
|
3965
cef66fdfff9e
allow suppress of dialog when filed-in classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3918
diff
changeset
|
3894 |
variableSignedLongLongSubclass:nameSymbol instanceVariableNames:instVarNameString classVariableNames:classVarString poolDictionaries:pool category:cat |
8551 | 3895 |
"create a new class as a subclass of an existing class (the receiver) |
3965
cef66fdfff9e
allow suppress of dialog when filed-in classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3918
diff
changeset
|
3896 |
in which the subclass has indexable signed long-long-sized nonpointer variables" |
3918
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
3897 |
|
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
3898 |
self isVariable ifTrue:[ |
11894 | 3899 |
self isSignedLongLongs ifFalse:[ |
3900 |
^ ClassBuildError raiseErrorString: |
|
17639 | 3901 |
('Cannot make variable signed long-long subclass "%1" of variable non-signed long-long class "%2"' |
3902 |
bindWith:nameSymbol with:self name) |
|
11894 | 3903 |
]. |
3918
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
3904 |
]. |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
3905 |
|
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
3906 |
^ self class |
11894 | 3907 |
name:nameSymbol |
3908 |
inEnvironment:(Class nameSpaceQuerySignal query) |
|
3909 |
subclassOf:self |
|
3910 |
instanceVariableNames:instVarNameString |
|
3911 |
variable:#signedLongLong |
|
3912 |
words:false |
|
3913 |
pointers:false |
|
3914 |
classVariableNames:classVarString |
|
3915 |
poolDictionaries:pool |
|
3916 |
category:cat |
|
3917 |
comment:nil |
|
3918 |
changed:true |
|
4056
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
3919 |
|
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
3920 |
"Modified: / 18.3.1999 / 18:19:35 / stefan" |
3918
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
3921 |
! |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
3922 |
|
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3923 |
variableSignedLongSubclass:nameSymbol instanceVariableNames:instVarNameString classVariableNames:classVarString poolDictionaries:pool category:cat |
8551 | 3924 |
"create a new class as a subclass of an existing class (the receiver) |
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3925 |
in which the subclass has indexable signed long-sized nonpointer variables" |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3926 |
|
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3927 |
self isVariable ifTrue:[ |
11894 | 3928 |
self isSignedLongs ifFalse:[ |
3929 |
^ ClassBuildError raiseErrorString: |
|
17639 | 3930 |
('Cannot make variable signed long subclass "%1" of variable non-signed long class "%2"' |
3931 |
bindWith:nameSymbol with:self name) |
|
11894 | 3932 |
]. |
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3933 |
]. |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3934 |
|
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3935 |
^ self class |
11894 | 3936 |
name:nameSymbol |
3937 |
inEnvironment:(Class nameSpaceQuerySignal query) |
|
3938 |
subclassOf:self |
|
3939 |
instanceVariableNames:instVarNameString |
|
3940 |
variable:#signedLong |
|
3941 |
words:false |
|
3942 |
pointers:false |
|
3943 |
classVariableNames:classVarString |
|
3944 |
poolDictionaries:pool |
|
3945 |
category:cat |
|
3946 |
comment:nil |
|
3947 |
changed:true |
|
4056
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
3948 |
|
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
3949 |
"Created: / 12.10.1996 / 19:18:31 / cg" |
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
3950 |
"Modified: / 6.11.1996 / 22:48:32 / cg" |
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
3951 |
"Modified: / 18.3.1999 / 18:19:41 / stefan" |
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3952 |
! |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3953 |
|
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3954 |
variableSignedWordSubclass:nameSymbol instanceVariableNames:instVarNameString classVariableNames:classVarString poolDictionaries:pool category:cat |
8551 | 3955 |
"create a new class as a subclass of an existing class (the receiver) |
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3956 |
in which the subclass has indexable word-sized signed nonpointer variables" |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3957 |
|
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3958 |
self isVariable ifTrue:[ |
11894 | 3959 |
self isSignedWords ifFalse:[ |
3960 |
^ ClassBuildError raiseErrorString: |
|
17639 | 3961 |
('Cannot make variable signed word subclass "%1" of variable non-signed word class "%2"' |
3962 |
bindWith:nameSymbol with:self name) |
|
11894 | 3963 |
]. |
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3964 |
]. |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3965 |
|
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3966 |
^ self class |
11894 | 3967 |
name:nameSymbol |
3968 |
inEnvironment:(Class nameSpaceQuerySignal query) |
|
3969 |
subclassOf:self |
|
3970 |
instanceVariableNames:instVarNameString |
|
3971 |
variable:#signedWord |
|
3972 |
words:false |
|
3973 |
pointers:false |
|
3974 |
classVariableNames:classVarString |
|
3975 |
poolDictionaries:pool |
|
3976 |
category:cat |
|
3977 |
comment:nil |
|
3978 |
changed:true |
|
4056
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
3979 |
|
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
3980 |
"Created: / 12.10.1996 / 19:18:34 / cg" |
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
3981 |
"Modified: / 6.11.1996 / 22:48:35 / cg" |
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
3982 |
"Modified: / 18.3.1999 / 18:19:51 / stefan" |
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3983 |
! |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3984 |
|
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3985 |
variableSubclass:nameSymbol instanceVariableNames:instVarNameString classVariableNames:classVarString poolDictionaries:pool category:cat |
8551 | 3986 |
"create a new class as a subclass of an existing class (the receiver) |
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3987 |
in which the subclass has indexable pointer variables" |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3988 |
|
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3989 |
self isVariable ifTrue:[ |
11894 | 3990 |
self isPointers ifFalse:[ |
3991 |
^ ClassBuildError raiseErrorString: |
|
17639 | 3992 |
('Cannot make variable pointer subclass "%1" of variable non-pointer class "%2"' |
3993 |
bindWith:nameSymbol with:self name) |
|
11894 | 3994 |
] |
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3995 |
]. |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3996 |
|
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
3997 |
^ self class |
11894 | 3998 |
name:nameSymbol |
3999 |
inEnvironment:(Class nameSpaceQuerySignal query) |
|
4000 |
subclassOf:self |
|
4001 |
instanceVariableNames:instVarNameString |
|
4002 |
variable:true |
|
4003 |
words:false |
|
4004 |
pointers:true |
|
4005 |
classVariableNames:classVarString |
|
4006 |
poolDictionaries:pool |
|
4007 |
category:cat |
|
4008 |
comment:nil |
|
4009 |
changed:true |
|
4056
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
4010 |
|
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
4011 |
"Created: / 12.10.1996 / 19:18:37 / cg" |
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
4012 |
"Modified: / 6.11.1996 / 22:48:40 / cg" |
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
4013 |
"Modified: / 18.3.1999 / 18:20:01 / stefan" |
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4014 |
! |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4015 |
|
6817 | 4016 |
variableSubclass:nameSymbol instanceVariableNames:instVarNameString classVariableNames:classVarString poolDictionaries:pool category:cat classInstanceVariableNames:classInstanceVariableNames |
8551 | 4017 |
"create a new class as a subclass of an existing class (the receiver) |
6817 | 4018 |
in which the subclass has indexable pointer variables" |
4019 |
||
4020 |
self isVariable ifTrue:[ |
|
11894 | 4021 |
self isPointers ifFalse:[ |
4022 |
^ ClassBuildError raiseErrorString: |
|
17639 | 4023 |
('Cannot make variable pointer subclass "%1" of variable non-pointer class "%2"' |
4024 |
bindWith:nameSymbol with:self name) |
|
11894 | 4025 |
] |
6817 | 4026 |
]. |
4027 |
||
4028 |
^ self class |
|
11894 | 4029 |
name:nameSymbol |
4030 |
inEnvironment:(Class nameSpaceQuerySignal query) |
|
4031 |
subclassOf:self |
|
4032 |
instanceVariableNames:instVarNameString |
|
4033 |
variable:true |
|
4034 |
words:false |
|
4035 |
pointers:true |
|
4036 |
classVariableNames:classVarString |
|
4037 |
poolDictionaries:pool |
|
4038 |
category:cat |
|
4039 |
comment:nil |
|
4040 |
changed:true |
|
4041 |
classInstanceVariableNames:classInstanceVariableNames |
|
6817 | 4042 |
|
4043 |
"Created: / 12.10.1996 / 19:18:37 / cg" |
|
4044 |
"Modified: / 6.11.1996 / 22:48:40 / cg" |
|
4045 |
"Modified: / 18.3.1999 / 18:20:01 / stefan" |
|
4046 |
! |
|
4047 |
||
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4048 |
variableWordSubclass:nameSymbol instanceVariableNames:instVarNameString classVariableNames:classVarString poolDictionaries:pool category:cat |
8551 | 4049 |
"create a new class as a subclass of an existing class (the receiver) |
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4050 |
in which the subclass has indexable word-sized nonpointer variables" |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4051 |
|
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4052 |
self isVariable ifTrue:[ |
11894 | 4053 |
self isWords ifFalse:[ |
4054 |
self isBytes ifFalse:[ |
|
4055 |
^ ClassBuildError raiseErrorString: |
|
17639 | 4056 |
('Cannot make variable word subclass "%1" of variable non-word class "%2"' |
4057 |
bindWith:nameSymbol with:self name) |
|
11894 | 4058 |
] |
4059 |
]. |
|
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4060 |
]. |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4061 |
|
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4062 |
^ self class |
11894 | 4063 |
name:nameSymbol |
4064 |
inEnvironment:(Class nameSpaceQuerySignal query) |
|
4065 |
subclassOf:self |
|
4066 |
instanceVariableNames:instVarNameString |
|
4067 |
variable:true |
|
4068 |
words:true |
|
4069 |
pointers:false |
|
4070 |
classVariableNames:classVarString |
|
4071 |
poolDictionaries:pool |
|
4072 |
category:cat |
|
4073 |
comment:nil |
|
4074 |
changed:true |
|
4056
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
4075 |
|
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
4076 |
"Created: / 12.10.1996 / 19:18:40 / cg" |
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
4077 |
"Modified: / 6.11.1996 / 22:48:43 / cg" |
be7526a49a8b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4049
diff
changeset
|
4078 |
"Modified: / 18.3.1999 / 18:20:07 / stefan" |
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4079 |
! ! |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4080 |
|
7262 | 4081 |
!ClassDescription methodsFor:'subclass creation-private classes'! |
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4082 |
|
18481 | 4083 |
subclass:nameSymbol instanceVariableNames:instVarNameString classVariableNames:classVarString poolDictionaries:pool privateIn:ownerClassArg |
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4084 |
"create a new class as a subclass of an existing class (the receiver). |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4085 |
The subclass will have indexed variables if the receiving-class has." |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4086 |
|
18481 | 4087 |
|category ownerClass| |
4088 |
||
4089 |
(ownerClass := ownerClassArg) isNil ifTrue:[ |
|
23008 | 4090 |
self proceedableError:'Nil (undefined) owner class - proceed to define as global'. |
18481 | 4091 |
ownerClass := Smalltalk. |
4092 |
] ifFalse:[ |
|
4093 |
category := ownerClass category |
|
10505
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4094 |
]. |
18481 | 4095 |
|
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4096 |
self isVariable ifFalse:[ |
10505
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4097 |
^ self class |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4098 |
name:nameSymbol |
18481 | 4099 |
inEnvironment:ownerClass |
10505
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4100 |
subclassOf:self |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4101 |
instanceVariableNames:instVarNameString |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4102 |
variable:false |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4103 |
words:true |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4104 |
pointers:true |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4105 |
classVariableNames:classVarString |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4106 |
poolDictionaries:pool |
18481 | 4107 |
category:category |
10505
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4108 |
comment:nil |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4109 |
changed:true. |
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4110 |
]. |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4111 |
self isBytes ifTrue:[ |
10505
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4112 |
^ self |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4113 |
variableByteSubclass:nameSymbol |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4114 |
instanceVariableNames:instVarNameString |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4115 |
classVariableNames:classVarString |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4116 |
poolDictionaries:pool |
18481 | 4117 |
privateIn:ownerClass |
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4118 |
]. |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4119 |
self isLongs ifTrue:[ |
10505
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4120 |
^ self |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4121 |
variableLongSubclass:nameSymbol |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4122 |
instanceVariableNames:instVarNameString |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4123 |
classVariableNames:classVarString |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4124 |
poolDictionaries:pool |
18481 | 4125 |
privateIn:ownerClass |
3918
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
4126 |
]. |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
4127 |
self isLongLongs ifTrue:[ |
10505
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4128 |
^ self |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4129 |
variableLongLongSubclass:nameSymbol |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4130 |
instanceVariableNames:instVarNameString |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4131 |
classVariableNames:classVarString |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4132 |
poolDictionaries:pool |
18481 | 4133 |
privateIn:ownerClass |
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4134 |
]. |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4135 |
self isFloats ifTrue:[ |
10505
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4136 |
^ self |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4137 |
variableFloatSubclass:nameSymbol |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4138 |
instanceVariableNames:instVarNameString |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4139 |
classVariableNames:classVarString |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4140 |
poolDictionaries:pool |
18481 | 4141 |
privateIn:ownerClass |
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4142 |
]. |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4143 |
self isDoubles ifTrue:[ |
10505
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4144 |
^ self |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4145 |
variableDoubleSubclass:nameSymbol |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4146 |
instanceVariableNames:instVarNameString |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4147 |
classVariableNames:classVarString |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4148 |
poolDictionaries:pool |
18481 | 4149 |
privateIn:ownerClass |
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4150 |
]. |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4151 |
self isWords ifTrue:[ |
10505
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4152 |
^ self |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4153 |
variableWordSubclass:nameSymbol |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4154 |
instanceVariableNames:instVarNameString |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4155 |
classVariableNames:classVarString |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4156 |
poolDictionaries:pool |
18481 | 4157 |
privateIn:ownerClass |
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4158 |
]. |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4159 |
self isSignedWords ifTrue:[ |
10505
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4160 |
^ self |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4161 |
variableSignedWordSubclass:nameSymbol |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4162 |
instanceVariableNames:instVarNameString |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4163 |
classVariableNames:classVarString |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4164 |
poolDictionaries:pool |
18481 | 4165 |
privateIn:ownerClass |
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4166 |
]. |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4167 |
self isSignedLongs ifTrue:[ |
10505
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4168 |
^ self |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4169 |
variableSignedLongSubclass:nameSymbol |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4170 |
instanceVariableNames:instVarNameString |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4171 |
classVariableNames:classVarString |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4172 |
poolDictionaries:pool |
18481 | 4173 |
privateIn:ownerClass |
3918
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
4174 |
]. |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
4175 |
self isSignedLongLongs ifTrue:[ |
10505
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4176 |
^ self |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4177 |
variableSignedLongLongSubclass:nameSymbol |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4178 |
instanceVariableNames:instVarNameString |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4179 |
classVariableNames:classVarString |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4180 |
poolDictionaries:pool |
18481 | 4181 |
privateIn:ownerClass |
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4182 |
]. |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4183 |
|
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4184 |
^ self |
10505
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4185 |
variableSubclass:nameSymbol |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4186 |
instanceVariableNames:instVarNameString |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4187 |
classVariableNames:classVarString |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4188 |
poolDictionaries:pool |
23008 | 4189 |
privateIn:ownerClass |
10505
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4190 |
|
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4191 |
"Created: / 11-10-1996 / 16:30:53 / cg" |
3f334264b315
raise an error, if the owningclass is nil in ...privateIn:
Claus Gittinger <cg@exept.de>
parents:
10477
diff
changeset
|
4192 |
"Modified: / 31-03-2007 / 10:20:38 / cg" |
23008 | 4193 |
"Modified: / 24-05-2018 / 21:06:45 / Claus Gittinger" |
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4194 |
! |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4195 |
|
18481 | 4196 |
variableByteSubclass:nameSymbol instanceVariableNames:instVarNameString classVariableNames:classVarString poolDictionaries:pool privateIn:ownerClass |
8551 | 4197 |
"create a new class as a subclass of an existing class (the receiver) |
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4198 |
in which the subclass has indexable byte-sized nonpointer variables" |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4199 |
|
18481 | 4200 |
|category| |
4201 |
||
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4202 |
self isVariable ifTrue:[ |
18481 | 4203 |
self isBytes ifFalse:[ |
4204 |
^ self error: |
|
4205 |
'cannot make a variable byte subclass of a variable non-byte class' |
|
4206 |
]. |
|
4207 |
]. |
|
4208 |
||
4209 |
ownerClass isNil ifTrue:[ |
|
23008 | 4210 |
self proceedableError:'Nil (undefined) owner class - proceed to define as global'. |
18481 | 4211 |
] ifFalse:[ |
4212 |
category := ownerClass category |
|
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4213 |
]. |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4214 |
|
8306 | 4215 |
^ self class |
18481 | 4216 |
name:nameSymbol |
4217 |
inEnvironment:ownerClass |
|
4218 |
subclassOf:self |
|
4219 |
instanceVariableNames:instVarNameString |
|
4220 |
variable:true |
|
4221 |
words:false |
|
4222 |
pointers:false |
|
4223 |
classVariableNames:classVarString |
|
4224 |
poolDictionaries:pool |
|
4225 |
category:category |
|
4226 |
comment:nil |
|
4227 |
changed:true. |
|
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4228 |
|
23008 | 4229 |
"Created: / 11-10-1996 / 16:31:27 / cg" |
4230 |
"Modified: / 04-07-1999 / 18:42:36 / cg" |
|
4231 |
"Modified: / 24-05-2018 / 21:07:00 / Claus Gittinger" |
|
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4232 |
! |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4233 |
|
8551 | 4234 |
variableDoubleSubclass:nameSymbol instanceVariableNames:instVarNameString classVariableNames:classVarString poolDictionaries:pool privateIn:aClass |
4235 |
||
4236 |
"create a new class as a subclass of an existing class (the receiver) |
|
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4237 |
in which the subclass has indexable double-sized nonpointer variables" |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4238 |
|
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4239 |
self isVariable ifTrue:[ |
8551 | 4240 |
self isDoubles ifFalse:[ |
4241 |
^ self error: |
|
4242 |
'cannot make a variable double subclass of a variable non-double class' |
|
4243 |
]. |
|
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4244 |
]. |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4245 |
|
8306 | 4246 |
^ self class |
8551 | 4247 |
name:nameSymbol |
4248 |
inEnvironment:aClass |
|
4249 |
subclassOf:self |
|
4250 |
instanceVariableNames:instVarNameString |
|
4251 |
variable:#double |
|
4252 |
words:false |
|
4253 |
pointers:false |
|
4254 |
classVariableNames:classVarString |
|
4255 |
poolDictionaries:pool |
|
4256 |
category:(aClass category) |
|
4257 |
comment:nil |
|
4258 |
changed:true. |
|
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4259 |
|
4329 | 4260 |
"Created: / 11.10.1996 / 16:32:23 / cg" |
4261 |
"Modified: / 4.7.1999 / 18:42:41 / cg" |
|
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4262 |
! |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4263 |
|
8551 | 4264 |
variableFloatSubclass:nameSymbol instanceVariableNames:instVarNameString classVariableNames:classVarString poolDictionaries:pool privateIn:aClass |
4265 |
"create a new class as a subclass of an existing class (the receiver) |
|
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4266 |
in which the subclass has indexable float-sized nonpointer variables" |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4267 |
|
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4268 |
self isVariable ifTrue:[ |
8551 | 4269 |
self isFloats ifFalse:[ |
4270 |
^ self error: |
|
4271 |
'cannot make a variable float subclass of a variable non-float class' |
|
4272 |
]. |
|
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4273 |
]. |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4274 |
|
8306 | 4275 |
^ self class |
8551 | 4276 |
name:nameSymbol |
4277 |
inEnvironment:aClass |
|
4278 |
subclassOf:self |
|
4279 |
instanceVariableNames:instVarNameString |
|
4280 |
variable:#float |
|
4281 |
words:false |
|
4282 |
pointers:false |
|
4283 |
classVariableNames:classVarString |
|
4284 |
poolDictionaries:pool |
|
4285 |
category:(aClass category) |
|
4286 |
comment:nil |
|
4287 |
changed:true. |
|
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4288 |
|
4329 | 4289 |
"Created: / 11.10.1996 / 16:32:37 / cg" |
4290 |
"Modified: / 4.7.1999 / 18:42:45 / cg" |
|
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4291 |
! |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4292 |
|
8551 | 4293 |
variableLongLongSubclass:nameSymbol instanceVariableNames:instVarNameString classVariableNames:classVarString poolDictionaries:pool privateIn:aClass |
4294 |
"create a new class as a subclass of an existing class (the receiver) |
|
3965
cef66fdfff9e
allow suppress of dialog when filed-in classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3918
diff
changeset
|
4295 |
in which the subclass has indexable longlong-sized nonpointer variables" |
cef66fdfff9e
allow suppress of dialog when filed-in classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3918
diff
changeset
|
4296 |
|
cef66fdfff9e
allow suppress of dialog when filed-in classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3918
diff
changeset
|
4297 |
self isVariable ifTrue:[ |
8551 | 4298 |
self isLongLongs ifFalse:[ |
4299 |
^ self error: |
|
4300 |
'cannot make a variable longlong subclass of a variable non-longlong class' |
|
4301 |
]. |
|
3965
cef66fdfff9e
allow suppress of dialog when filed-in classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3918
diff
changeset
|
4302 |
]. |
cef66fdfff9e
allow suppress of dialog when filed-in classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3918
diff
changeset
|
4303 |
|
8306 | 4304 |
^ self class |
8551 | 4305 |
name:nameSymbol |
4306 |
inEnvironment:aClass |
|
4307 |
subclassOf:self |
|
4308 |
instanceVariableNames:instVarNameString |
|
4309 |
variable:#longLong |
|
4310 |
words:false |
|
4311 |
pointers:false |
|
4312 |
classVariableNames:classVarString |
|
4313 |
poolDictionaries:pool |
|
4314 |
category:(aClass category) |
|
4315 |
comment:nil |
|
4316 |
changed:true. |
|
3965
cef66fdfff9e
allow suppress of dialog when filed-in classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3918
diff
changeset
|
4317 |
|
4329 | 4318 |
"Created: / 11.10.1996 / 16:32:48 / cg" |
4319 |
"Modified: / 4.7.1999 / 18:42:49 / cg" |
|
3965
cef66fdfff9e
allow suppress of dialog when filed-in classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3918
diff
changeset
|
4320 |
! |
cef66fdfff9e
allow suppress of dialog when filed-in classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3918
diff
changeset
|
4321 |
|
8551 | 4322 |
variableLongSubclass:nameSymbol instanceVariableNames:instVarNameString classVariableNames:classVarString poolDictionaries:pool privateIn:aClass |
4323 |
"create a new class as a subclass of an existing class (the receiver) |
|
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4324 |
in which the subclass has indexable long-sized nonpointer variables" |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4325 |
|
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4326 |
self isVariable ifTrue:[ |
8551 | 4327 |
self isLongs ifFalse:[ |
4328 |
^ self error: |
|
4329 |
'cannot make a variable long subclass of a variable non-long class' |
|
4330 |
]. |
|
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4331 |
]. |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4332 |
|
8306 | 4333 |
^ self class |
8551 | 4334 |
name:nameSymbol |
4335 |
inEnvironment:aClass |
|
4336 |
subclassOf:self |
|
4337 |
instanceVariableNames:instVarNameString |
|
4338 |
variable:#long |
|
4339 |
words:false |
|
4340 |
pointers:false |
|
4341 |
classVariableNames:classVarString |
|
4342 |
poolDictionaries:pool |
|
4343 |
category:(aClass category) |
|
4344 |
comment:nil |
|
4345 |
changed:true. |
|
3918
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
4346 |
|
4329 | 4347 |
"Created: / 11.10.1996 / 16:32:48 / cg" |
4348 |
"Modified: / 4.7.1999 / 18:42:53 / cg" |
|
3918
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
4349 |
! |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
4350 |
|
8551 | 4351 |
variableSignedLongLongSubclass:nameSymbol instanceVariableNames:instVarNameString classVariableNames:classVarString poolDictionaries:pool privateIn:aClass |
4352 |
"create a new class as a subclass of an existing class (the receiver) |
|
3965
cef66fdfff9e
allow suppress of dialog when filed-in classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3918
diff
changeset
|
4353 |
in which the subclass has indexable signed longlong-sized nonpointer variables" |
3918
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
4354 |
|
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
4355 |
self isVariable ifTrue:[ |
8551 | 4356 |
self isSignedLongLongs ifFalse:[ |
4357 |
^ self error: |
|
4358 |
'cannot make a variable signed longlong subclass of a variable non-longlong class' |
|
4359 |
]. |
|
3918
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
4360 |
]. |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
4361 |
|
8306 | 4362 |
^ self class |
8551 | 4363 |
name:nameSymbol |
4364 |
inEnvironment:aClass |
|
4365 |
subclassOf:self |
|
4366 |
instanceVariableNames:instVarNameString |
|
4367 |
variable:#signedLongLong |
|
4368 |
words:false |
|
4369 |
pointers:false |
|
4370 |
classVariableNames:classVarString |
|
4371 |
poolDictionaries:pool |
|
4372 |
category:(aClass category) |
|
4373 |
comment:nil |
|
4374 |
changed:true. |
|
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4375 |
|
4329 | 4376 |
"Created: / 11.10.1996 / 16:46:30 / cg" |
4377 |
"Modified: / 4.7.1999 / 18:42:57 / cg" |
|
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4378 |
! |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4379 |
|
8551 | 4380 |
variableSignedLongSubclass:nameSymbol instanceVariableNames:instVarNameString classVariableNames:classVarString poolDictionaries:pool privateIn:aClass |
4381 |
"create a new class as a subclass of an existing class (the receiver) |
|
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4382 |
in which the subclass has indexable signed long-sized nonpointer variables" |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4383 |
|
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4384 |
self isVariable ifTrue:[ |
8551 | 4385 |
self isSignedLongs ifFalse:[ |
4386 |
^ self error: |
|
4387 |
'cannot make a variable signed long subclass of a variable non-long class' |
|
4388 |
]. |
|
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4389 |
]. |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4390 |
|
8306 | 4391 |
^ self class |
8551 | 4392 |
name:nameSymbol |
4393 |
inEnvironment:aClass |
|
4394 |
subclassOf:self |
|
4395 |
instanceVariableNames:instVarNameString |
|
4396 |
variable:#signedLong |
|
4397 |
words:false |
|
4398 |
pointers:false |
|
4399 |
classVariableNames:classVarString |
|
4400 |
poolDictionaries:pool |
|
4401 |
category:(aClass category) |
|
4402 |
comment:nil |
|
4403 |
changed:true. |
|
3918
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
4404 |
|
4329 | 4405 |
"Created: / 11.10.1996 / 16:46:30 / cg" |
4406 |
"Modified: / 4.7.1999 / 18:43:03 / cg" |
|
3918
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
4407 |
! |
32af25a0d71e
added new subclass messages for longLong and signedLongLong indexed classes
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
4408 |
|
8551 | 4409 |
variableSignedWordSubclass:nameSymbol instanceVariableNames:instVarNameString classVariableNames:classVarString poolDictionaries:pool privateIn:aClass |
4410 |
"create a new class as a subclass of an existing class (the receiver) |
|
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4411 |
in which the subclass has indexable word-sized signed nonpointer variables" |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4412 |
|
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4413 |
self isVariable ifTrue:[ |
8551 | 4414 |
self isSignedWords ifFalse:[ |
4415 |
^ self error: |
|
4416 |
'cannot make a variable signed word subclass of a variable non-word class' |
|
4417 |
]. |
|
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4418 |
]. |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4419 |
|
8306 | 4420 |
^ self class |
8551 | 4421 |
name:nameSymbol |
4422 |
inEnvironment:aClass |
|
4423 |
subclassOf:self |
|
4424 |
instanceVariableNames:instVarNameString |
|
4425 |
variable:#signedWord |
|
4426 |
words:false |
|
4427 |
pointers:false |
|
4428 |
classVariableNames:classVarString |
|
4429 |
poolDictionaries:pool |
|
4430 |
category:(aClass category) |
|
4431 |
comment:nil |
|
4432 |
changed:true. |
|
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4433 |
|
4329 | 4434 |
"Created: / 11.10.1996 / 16:46:44 / cg" |
4435 |
"Modified: / 4.7.1999 / 18:43:06 / cg" |
|
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4436 |
! |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4437 |
|
18481 | 4438 |
variableSubclass:nameSymbol instanceVariableNames:instVarNameString classVariableNames:classVarString poolDictionaries:pool privateIn:ownerClass |
8551 | 4439 |
"create a new class as a subclass of an existing class (the receiver) |
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4440 |
in which the subclass has indexable pointer variables" |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4441 |
|
18481 | 4442 |
|category| |
4443 |
||
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4444 |
self isVariable ifTrue:[ |
18481 | 4445 |
self isPointers ifFalse:[ |
4446 |
^ self error: |
|
4447 |
'cannot make a variable pointer subclass of a variable non-pointer class' |
|
4448 |
] |
|
4449 |
]. |
|
4450 |
||
4451 |
ownerClass isNil ifTrue:[ |
|
4452 |
self error:'Nil (undefined) owner class - proceed to define as global' mayProceed:true. |
|
4453 |
] ifFalse:[ |
|
4454 |
category := ownerClass category |
|
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4455 |
]. |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4456 |
|
8306 | 4457 |
^ self class |
18481 | 4458 |
name:nameSymbol |
4459 |
inEnvironment:ownerClass |
|
4460 |
subclassOf:self |
|
4461 |
instanceVariableNames:instVarNameString |
|
4462 |
variable:true |
|
4463 |
words:false |
|
4464 |
pointers:true |
|
4465 |
classVariableNames:classVarString |
|
4466 |
poolDictionaries:pool |
|
4467 |
category:category |
|
4468 |
comment:nil |
|
4469 |
changed:true. |
|
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4470 |
|
4329 | 4471 |
"Created: / 11.10.1996 / 16:54:33 / cg" |
4472 |
"Modified: / 4.7.1999 / 18:43:10 / cg" |
|
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4473 |
! |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4474 |
|
8551 | 4475 |
variableWordSubclass:nameSymbol instanceVariableNames:instVarNameString classVariableNames:classVarString poolDictionaries:pool privateIn:aClass |
4476 |
"create a new class as a subclass of an existing class (the receiver) |
|
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4477 |
in which the subclass has indexable word-sized nonpointer variables" |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4478 |
|
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4479 |
self isVariable ifTrue:[ |
8551 | 4480 |
self isWords ifFalse:[ |
4481 |
^ self error: |
|
4482 |
'cannot make a variable word subclass of a variable non-word class' |
|
4483 |
]. |
|
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4484 |
]. |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4485 |
|
8306 | 4486 |
^ self class |
8551 | 4487 |
name:nameSymbol |
4488 |
inEnvironment:aClass |
|
4489 |
subclassOf:self |
|
4490 |
instanceVariableNames:instVarNameString |
|
4491 |
variable:true |
|
4492 |
words:true |
|
4493 |
pointers:false |
|
4494 |
classVariableNames:classVarString |
|
4495 |
poolDictionaries:pool |
|
4496 |
category:(aClass category) |
|
4497 |
comment:nil |
|
4498 |
changed:true. |
|
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4499 |
|
4329 | 4500 |
"Created: / 11.10.1996 / 16:54:48 / cg" |
4501 |
"Modified: / 4.7.1999 / 18:43:18 / cg" |
|
1715
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4502 |
! ! |
8bd2a2d8fbb4
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1669
diff
changeset
|
4503 |
|
8484
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4504 |
!ClassDescription::PackageRedefinition methodsFor:'accessing'! |
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4505 |
|
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4506 |
newPackage |
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4507 |
"answer the package of the class/method to be defined" |
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4508 |
|
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4509 |
^ parameter value package |
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4510 |
! |
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4511 |
|
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4512 |
oldPackage |
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4513 |
"answer the package of the class/method to be overwritten" |
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4514 |
|
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4515 |
^ parameter key package |
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4516 |
! ! |
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4517 |
|
4604
a08bfac91f07
migrated redefinitionSignals to new exception scheme
Claus Gittinger <cg@exept.de>
parents:
4358
diff
changeset
|
4518 |
!ClassDescription::PackageRedefinition methodsFor:'default actions'! |
a08bfac91f07
migrated redefinitionSignals to new exception scheme
Claus Gittinger <cg@exept.de>
parents:
4358
diff
changeset
|
4519 |
|
8484
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4520 |
defaultResumeValue |
10973
ed7abd297641
Bug 824: The default value for PackageRedefinition is now #continue
Stefan Vogel <sv@exept.de>
parents:
10505
diff
changeset
|
4521 |
"the default resume value is to return #continue. |
ed7abd297641
Bug 824: The default value for PackageRedefinition is now #continue
Stefan Vogel <sv@exept.de>
parents:
10505
diff
changeset
|
4522 |
This causes the new method/class to be installed under the new package. |
ed7abd297641
Bug 824: The default value for PackageRedefinition is now #continue
Stefan Vogel <sv@exept.de>
parents:
10505
diff
changeset
|
4523 |
This behavior is compatible with the default behavior when CatchMethodRedefinitions |
ed7abd297641
Bug 824: The default value for PackageRedefinition is now #continue
Stefan Vogel <sv@exept.de>
parents:
10505
diff
changeset
|
4524 |
is false." |
ed7abd297641
Bug 824: The default value for PackageRedefinition is now #continue
Stefan Vogel <sv@exept.de>
parents:
10505
diff
changeset
|
4525 |
|
ed7abd297641
Bug 824: The default value for PackageRedefinition is now #continue
Stefan Vogel <sv@exept.de>
parents:
10505
diff
changeset
|
4526 |
"See Bug 824 before changing this" |
ed7abd297641
Bug 824: The default value for PackageRedefinition is now #continue
Stefan Vogel <sv@exept.de>
parents:
10505
diff
changeset
|
4527 |
|
ed7abd297641
Bug 824: The default value for PackageRedefinition is now #continue
Stefan Vogel <sv@exept.de>
parents:
10505
diff
changeset
|
4528 |
^ #continue |
8484
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4529 |
! ! |
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4530 |
|
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4531 |
!ClassDescription::MethodRedefinitionNotification class methodsFor:'initialization'! |
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4532 |
|
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4533 |
initialize |
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4534 |
NotifierString := 'attempt to redefine method from a different package' |
4604
a08bfac91f07
migrated redefinitionSignals to new exception scheme
Claus Gittinger <cg@exept.de>
parents:
4358
diff
changeset
|
4535 |
! ! |
a08bfac91f07
migrated redefinitionSignals to new exception scheme
Claus Gittinger <cg@exept.de>
parents:
4358
diff
changeset
|
4536 |
|
8484
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4537 |
!ClassDescription::MethodRedefinitionNotification methodsFor:'accessing'! |
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4538 |
|
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4539 |
newMethod |
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4540 |
"answer the new method to be defined" |
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4541 |
|
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4542 |
^ parameter value |
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4543 |
! |
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4544 |
|
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4545 |
oldMethod |
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4546 |
"answer the old method to be overwritten" |
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4547 |
|
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4548 |
^ parameter key |
5750
4b3eae08b84b
preserve method-packages when recompiling
Claus Gittinger <cg@exept.de>
parents:
5725
diff
changeset
|
4549 |
! ! |
4b3eae08b84b
preserve method-packages when recompiling
Claus Gittinger <cg@exept.de>
parents:
5725
diff
changeset
|
4550 |
|
8484
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4551 |
!ClassDescription::ClassRedefinitionNotification class methodsFor:'initialization'! |
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4552 |
|
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4553 |
initialize |
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4554 |
NotifierString := 'attempt to redefine a class from different package' |
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4555 |
! ! |
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4556 |
|
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4557 |
!ClassDescription::ClassRedefinitionNotification methodsFor:'accessing'! |
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4558 |
|
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4559 |
newClass |
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4560 |
"answer the new class to be defined" |
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4561 |
|
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4562 |
^ parameter value |
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4563 |
! |
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4564 |
|
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4565 |
oldClass |
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4566 |
"answer the old class to be overwritten" |
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4567 |
|
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4568 |
^ parameter key |
5725
00c2d5e78792
method category: and package: now send change notifications.
Claus Gittinger <cg@exept.de>
parents:
5722
diff
changeset
|
4569 |
! ! |
00c2d5e78792
method category: and package: now send change notifications.
Claus Gittinger <cg@exept.de>
parents:
5722
diff
changeset
|
4570 |
|
1740 | 4571 |
!ClassDescription class methodsFor:'documentation'! |
662 | 4572 |
|
4573 |
version |
|
18475 | 4574 |
^ '$Header$' |
12082 | 4575 |
! |
4576 |
||
4577 |
version_CVS |
|
18475 | 4578 |
^ '$Header$' |
662 | 4579 |
! ! |
6817 | 4580 |
|
14617 | 4581 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2533
diff
changeset
|
4582 |
ClassDescription initialize! |
8484
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4583 |
ClassDescription::MethodRedefinitionNotification initialize! |
e126be577565
Access methods for oldPackage and newPackage in notifications
Stefan Vogel <sv@exept.de>
parents:
8454
diff
changeset
|
4584 |
ClassDescription::ClassRedefinitionNotification initialize! |