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