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