author | Claus Gittinger <cg@exept.de> |
Sat, 20 Oct 2012 21:50:23 +0200 | |
changeset 14410 | 3c6d55f3bada |
parent 13288 | c525954778c6 |
child 14411 | 192aa172da63 |
permissions | -rw-r--r-- |
1 | 1 |
" |
5 | 2 |
COPYRIGHT (c) 1991 by Claus Gittinger |
154 | 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 |
" |
|
5345 | 12 |
"{ Package: 'stx:libbasic' }" |
13 |
||
620 | 14 |
nil subclass:#Autoload |
938
a23bc7f62ed1
set package info when autoloading
Claus Gittinger <cg@exept.de>
parents:
922
diff
changeset
|
15 |
instanceVariableNames:'' |
8588
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
16 |
classVariableNames:'LazyLoading AutoloadFailedSignal LoadedClasses InProgressClasses' |
938
a23bc7f62ed1
set package info when autoloading
Claus Gittinger <cg@exept.de>
parents:
922
diff
changeset
|
17 |
poolDictionaries:'' |
a23bc7f62ed1
set package info when autoloading
Claus Gittinger <cg@exept.de>
parents:
922
diff
changeset
|
18 |
category:'Kernel-Classes' |
1 | 19 |
! |
20 |
||
1862
e8f44f10f1ab
changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents:
1720
diff
changeset
|
21 |
!Autoload class methodsFor:'documentation'! |
68 | 22 |
|
88 | 23 |
copyright |
24 |
" |
|
25 |
COPYRIGHT (c) 1991 by Claus Gittinger |
|
154 | 26 |
All Rights Reserved |
88 | 27 |
|
28 |
This software is furnished under a license and may be used |
|
29 |
only in accordance with the terms of that license and with the |
|
30 |
inclusion of the above copyright notice. This software may not |
|
31 |
be provided or otherwise made available to, or used by, any |
|
32 |
other person. No title to or ownership of the software is |
|
33 |
hereby transferred. |
|
34 |
" |
|
35 |
! |
|
36 |
||
68 | 37 |
documentation |
38 |
" |
|
39 |
In memory limited systems (as my 8Mb 386 is) all seldom-used classes are made |
|
2662 | 40 |
subclasses of this class. |
41 |
Autoload catches all messages and files-In the corresponding code |
|
42 |
when first used. |
|
2689 | 43 |
Then the caught message is resent to the (now existing) class. |
2662 | 44 |
|
45 |
Class files are searched along the searchPath (see Smalltalk), |
|
46 |
and any of binary-classFile, byteCode-classFile or sourceFile are |
|
47 |
loaded, whichever is found first. For binaries to be loaded, |
|
48 |
these must be found in the 'bin' directory. Sources must be found |
|
49 |
in the 'source' directory. |
|
50 |
(Usually, Autoload classes finds the source file and loads that one). |
|
51 |
||
52 |
When started, the patches startup script arranges for the abbreviation |
|
53 |
file 'include/abbrev.stc' to be read and installs autoload stubs for |
|
7280
7afcccb7c856
Fix pidgin spelling: 'does not exists' and 'not exists'
Stefan Vogel <sv@exept.de>
parents:
7178
diff
changeset
|
54 |
all classes listed in that file, which do not exist already. |
2662 | 55 |
The abbreviation file is maintained by the production environment |
56 |
and updated by makefile rules - therefore, it should not be edited |
|
57 |
manually. |
|
68 | 58 |
|
59 |
Late addition: above comment is no longer true - I have made now almost |
|
60 |
all Demos & Goodies be autoloaded ... even for big systems. |
|
61 |
||
1278 | 62 |
[class variables:] |
92 | 63 |
|
7280
7afcccb7c856
Fix pidgin spelling: 'does not exists' and 'not exists'
Stefan Vogel <sv@exept.de>
parents:
7178
diff
changeset
|
64 |
LazyLoading <Boolean> if true, the loaded classes |
7afcccb7c856
Fix pidgin spelling: 'does not exists' and 'not exists'
Stefan Vogel <sv@exept.de>
parents:
7178
diff
changeset
|
65 |
methods will NOT be compiled at |
7afcccb7c856
Fix pidgin spelling: 'does not exists' and 'not exists'
Stefan Vogel <sv@exept.de>
parents:
7178
diff
changeset
|
66 |
autoload time, but instead when |
7afcccb7c856
Fix pidgin spelling: 'does not exists' and 'not exists'
Stefan Vogel <sv@exept.de>
parents:
7178
diff
changeset
|
67 |
first called. This allows for a |
7afcccb7c856
Fix pidgin spelling: 'does not exists' and 'not exists'
Stefan Vogel <sv@exept.de>
parents:
7178
diff
changeset
|
68 |
faster load. However, expect short |
7afcccb7c856
Fix pidgin spelling: 'does not exists' and 'not exists'
Stefan Vogel <sv@exept.de>
parents:
7178
diff
changeset
|
69 |
pauses later when the methods are |
7afcccb7c856
Fix pidgin spelling: 'does not exists' and 'not exists'
Stefan Vogel <sv@exept.de>
parents:
7178
diff
changeset
|
70 |
first executed. |
126 | 71 |
|
7280
7afcccb7c856
Fix pidgin spelling: 'does not exists' and 'not exists'
Stefan Vogel <sv@exept.de>
parents:
7178
diff
changeset
|
72 |
AutoloadFailedSignal <Signal> signal raised if an autoloaded |
7afcccb7c856
Fix pidgin spelling: 'does not exists' and 'not exists'
Stefan Vogel <sv@exept.de>
parents:
7178
diff
changeset
|
73 |
classes source is not available. |
922 | 74 |
|
7280
7afcccb7c856
Fix pidgin spelling: 'does not exists' and 'not exists'
Stefan Vogel <sv@exept.de>
parents:
7178
diff
changeset
|
75 |
LoadedClasses <Collection> set of classes that heve been |
7afcccb7c856
Fix pidgin spelling: 'does not exists' and 'not exists'
Stefan Vogel <sv@exept.de>
parents:
7178
diff
changeset
|
76 |
autoloaded (for later unload) |
1292 | 77 |
|
2662 | 78 |
[see also:] |
7280
7afcccb7c856
Fix pidgin spelling: 'does not exists' and 'not exists'
Stefan Vogel <sv@exept.de>
parents:
7178
diff
changeset
|
79 |
Smalltalk |
2662 | 80 |
|
1292 | 81 |
[author:] |
7280
7afcccb7c856
Fix pidgin spelling: 'does not exists' and 'not exists'
Stefan Vogel <sv@exept.de>
parents:
7178
diff
changeset
|
82 |
Claus Gittinger |
68 | 83 |
" |
84 |
! ! |
|
85 |
||
1862
e8f44f10f1ab
changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents:
1720
diff
changeset
|
86 |
!Autoload class methodsFor:'initialization'! |
126 | 87 |
|
88 |
initialize |
|
12252 | 89 |
"initialize either the Autoload class |
90 |
or load a autoloaded class and initialize it." |
|
2223 | 91 |
|
12252 | 92 |
self ~~ Autoload ifTrue:[ |
93 |
"subclass: catch initialize - load the class and resend #initialize to the real one" |
|
94 |
^ self doesNotUnderstand:(Message selector:#initialize) |
|
95 |
]. |
|
96 |
||
97 |
"initialize myself" |
|
126 | 98 |
AutoloadFailedSignal isNil ifTrue:[ |
7092
630807cd320f
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
7019
diff
changeset
|
99 |
LazyLoading := false. |
2654 | 100 |
|
12252 | 101 |
AutoloadFailedSignal := ProceedableError newSignal |
102 |
nameClass:self message:#autoloadFailedSignal; |
|
103 |
notifierString:'autoload failed'. |
|
197 | 104 |
|
7092
630807cd320f
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
7019
diff
changeset
|
105 |
self class changeClassTo:AutoloadMetaclass. |
630807cd320f
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
7019
diff
changeset
|
106 |
ObjectMemory flushCaches. |
5005 | 107 |
]. |
8316 | 108 |
LoadedClasses isNil ifTrue:[ |
109 |
LoadedClasses := IdentitySet new. |
|
12074 | 110 |
]. |
111 |
InProgressClasses isNil ifTrue:[ |
|
9461
791adb50075f
avoid "recursive autoload" error when doing explicit autoload of subclasses
Stefan Vogel <sv@exept.de>
parents:
9428
diff
changeset
|
112 |
InProgressClasses := IdentitySet new. |
8316 | 113 |
]. |
5005 | 114 |
|
2223 | 115 |
|
4511
da0b327f3204
Use AutoloadMetaclass to load a class on unhandled class methods.
Stefan Vogel <sv@exept.de>
parents:
4496
diff
changeset
|
116 |
"Modified: / 20.5.1997 / 19:06:25 / cg" |
da0b327f3204
Use AutoloadMetaclass to load a class on unhandled class methods.
Stefan Vogel <sv@exept.de>
parents:
4496
diff
changeset
|
117 |
"Modified: / 3.8.1999 / 14:23:30 / stefan" |
126 | 118 |
! ! |
119 |
||
1862
e8f44f10f1ab
changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents:
1720
diff
changeset
|
120 |
!Autoload class methodsFor:'Signal constants'! |
126 | 121 |
|
122 |
autoloadFailedSignal |
|
123 |
"return the signal raised when an autoload fails" |
|
124 |
||
125 |
^ AutoloadFailedSignal |
|
126 |
! ! |
|
127 |
||
1862
e8f44f10f1ab
changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents:
1720
diff
changeset
|
128 |
!Autoload class methodsFor:'adding/removing autoloaded classes'! |
359 | 129 |
|
216 | 130 |
addClass:aClassName |
4052 | 131 |
"given a name, install a corresponding autoload class stub for it. |
132 |
Return the (autoload-) stubClass or nil, if no new class was created." |
|
1277 | 133 |
|
4052 | 134 |
^ self addClass:aClassName inCategory:'autoloaded-Classes' |
216 | 135 |
|
136 |
" |
|
137 |
Autoload addClass:'Clock' |
|
138 |
" |
|
1277 | 139 |
|
140 |
"Modified: 24.4.1996 / 19:54:16 / cg" |
|
216 | 141 |
! |
142 |
||
143 |
addClass:aClassName inCategory:aCategory |
|
4052 | 144 |
"given a name, install a corresponding autoload class stub for it. |
145 |
Return the (autoload-) stubClass or nil, if no new class was created." |
|
1277 | 146 |
|
4052 | 147 |
|nameSymbol cls| |
216 | 148 |
|
149 |
nameSymbol := aClassName asSymbol. |
|
150 |
(Smalltalk at:nameSymbol) isNil ifTrue:[ |
|
5903 | 151 |
cls := Autoload |
152 |
subclass:nameSymbol |
|
153 |
instanceVariableNames:'' |
|
154 |
classVariableNames:'' |
|
155 |
poolDictionaries:'' |
|
156 |
category:aCategory. |
|
4052 | 157 |
]. |
158 |
^ cls |
|
159 |
||
216 | 160 |
" |
161 |
Autoload addClass:'Clock' inCategory:'autoloaded-Demos' |
|
162 |
" |
|
1277 | 163 |
|
164 |
"Modified: 24.4.1996 / 19:54:20 / cg" |
|
620 | 165 |
! |
166 |
||
167 |
removeClass:aClass |
|
1277 | 168 |
"remove a class from the list of loaded classes" |
169 |
||
620 | 170 |
LoadedClasses remove:aClass ifAbsent:[] |
1277 | 171 |
|
172 |
"Modified: 24.4.1996 / 19:54:35 / cg" |
|
620 | 173 |
! ! |
174 |
||
11145 | 175 |
!Autoload class methodsFor:'fileOut'! |
620 | 176 |
|
5345 | 177 |
basicFileOutDefinitionOn:aStream withNameSpace:forceNameSpace withPackage:withPackage |
620 | 178 |
"print an expression to define myself on aStream. |
8316 | 179 |
Since autoloaded classes don't know their real definition, simply |
620 | 180 |
output some comment string making things clear in the browser." |
181 |
||
5820 | 182 |
|myName fileName nm package| |
620 | 183 |
|
5345 | 184 |
(self == Autoload) ifTrue:[ |
7019 | 185 |
^ super |
186 |
basicFileOutDefinitionOn:aStream |
|
187 |
withNameSpace:forceNameSpace |
|
188 |
withPackage:withPackage |
|
5345 | 189 |
]. |
620 | 190 |
|
191 |
myName := self name. |
|
11205 | 192 |
aStream nextPutAll:'"' ; nextPutLine:'Notice:'; cr; |
193 |
spaces:4; nextPutLine:'The ',myName,' class is not yet loaded.'; cr. |
|
7019 | 194 |
aStream nextPutLine:'to load, execute: '. |
195 |
aStream cr; spaces:4; nextPutLine:myName , ' autoload'. |
|
14410
3c6d55f3bada
changed: #basicFileOutDefinitionOn:withNameSpace:withPackage:
Claus Gittinger <cg@exept.de>
parents:
13288
diff
changeset
|
196 |
aStream cr; nextPutLine:'or use the browser''s load-function (in the classList''s ''Special''-menu)'. |
11205 | 197 |
aStream nextPutLine:'(a double-click on the class will also load it).'. |
620 | 198 |
" |
199 |
the following is simply informative ... |
|
200 |
actually, its a hack & kludge - there ought to be a method for this |
|
201 |
in Smalltalk |
|
202 |
(knowing the details of loading here is no good coding style) |
|
203 |
" |
|
10052 | 204 |
fileName := (Smalltalk fileNameForClass:myName). |
620 | 205 |
(ObjectFileLoader notNil and:[Smalltalk loadBinaries]) ifTrue:[ |
7019 | 206 |
(nm := Smalltalk libraryFileNameOfClass:myName) notNil ifTrue:[ |
207 |
nm := nm , ' (a classLibrary, possibly including more classes)' |
|
208 |
] ifFalse:[ |
|
209 |
nm := Smalltalk getBinaryFileName:(fileName , '.so'). |
|
210 |
nm isNil ifTrue:[ |
|
211 |
nm := Smalltalk getBinaryFileName:(fileName , '.o') |
|
212 |
]. |
|
213 |
nm notNil ifTrue:[ |
|
214 |
nm := nm , ' (a classBinary)' |
|
215 |
] |
|
216 |
]. |
|
620 | 217 |
]. |
218 |
nm isNil ifTrue:[ |
|
7019 | 219 |
package := self package. |
220 |
package notNil ifTrue:[ |
|
221 |
nm := Smalltalk getSourceFileName:((package copyReplaceAll:$: with:$/) , '/' , fileName , '.st'). |
|
222 |
]. |
|
223 |
nm isNil ifTrue:[ |
|
224 |
nm := Smalltalk getSourceFileName:(fileName , '.st'). |
|
225 |
]. |
|
620 | 226 |
]. |
227 |
nm notNil ifTrue:[ |
|
7744 | 228 |
aStream |
229 |
cr; |
|
230 |
nextPutLine:'When accessed, ' , myName , ' will automatically be loaded'; |
|
231 |
nextPutLine:'from: '; spaces:4; nextPutAll:nm. |
|
232 |
||
7019 | 233 |
nm asFilename isSymbolicLink ifTrue:[ |
234 |
aStream cr; cr. |
|
7744 | 235 |
aStream |
236 |
nextPutLine:'which is a link to: '; |
|
237 |
spaces:4; |
|
238 |
nextPutAll:(nm asFilename linkInfo path). |
|
7019 | 239 |
] |
620 | 240 |
] ifFalse:[ |
7019 | 241 |
package := self package. |
242 |
(Smalltalk at:#SourceCodeManager) notNil ifTrue:[ |
|
243 |
aStream nextPutAll:' |
|
5076 | 244 |
When accessed, I''ll ask the sourceCodeManager to load the code |
245 |
from ''' , fileName , '.st'' in the ''' , package , ''' package.'. |
|
7019 | 246 |
] ifFalse:[ |
247 |
aStream nextPutAll:' |
|
5076 | 248 |
When accessed, I''ll search for a file named |
249 |
''' , fileName , '.st'' in the ''' , package , ''' package. |
|
709
c31cbd5e5323
more info for autoloaded classes (for browsers definition text)
Claus Gittinger <cg@exept.de>
parents:
661
diff
changeset
|
250 |
|
5076 | 251 |
Packages are tried along the packagePath, which is: |
252 |
' , ((Smalltalk packagePath asStringCollection collect:[:each| ' ' , each]) asStringWith:Character cr). |
|
7019 | 253 |
] |
620 | 254 |
]. |
255 |
aStream cr; nextPutAll:'"'. |
|
709
c31cbd5e5323
more info for autoloaded classes (for browsers definition text)
Claus Gittinger <cg@exept.de>
parents:
661
diff
changeset
|
256 |
|
10052 | 257 |
"Created: / 05-01-1997 / 14:31:33 / cg" |
258 |
"Modified: / 06-10-2006 / 16:17:18 / cg" |
|
620 | 259 |
! ! |
260 |
||
1862
e8f44f10f1ab
changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents:
1720
diff
changeset
|
261 |
!Autoload class methodsFor:'lazy compilation'! |
620 | 262 |
|
263 |
compileLazy |
|
264 |
"return the lazy loading flag - if on, fileIn is much faster, |
|
265 |
but pauses are to be expected later, since methods are compiled |
|
266 |
when first executed." |
|
267 |
||
268 |
^ LazyLoading |
|
269 |
! |
|
270 |
||
271 |
compileLazy:aBoolean |
|
272 |
"turn on/off lazy loading - if on, fileIn is much faster, |
|
273 |
but pauses are to be expected later, since methods are compiled |
|
274 |
when first executed. |
|
275 |
If you like it, add a line to your startup file." |
|
276 |
||
277 |
LazyLoading := aBoolean |
|
216 | 278 |
! ! |
279 |
||
1862
e8f44f10f1ab
changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents:
1720
diff
changeset
|
280 |
!Autoload class methodsFor:'loading'! |
1 | 281 |
|
282 |
autoload |
|
283 |
"use this to force loading |
|
9461
791adb50075f
avoid "recursive autoload" error when doing explicit autoload of subclasses
Stefan Vogel <sv@exept.de>
parents:
9428
diff
changeset
|
284 |
- it is defined a noop in all non-autoloading classes. |
791adb50075f
avoid "recursive autoload" error when doing explicit autoload of subclasses
Stefan Vogel <sv@exept.de>
parents:
9428
diff
changeset
|
285 |
Return the loaded class" |
1 | 286 |
|
9554 | 287 |
|myName myNameSpace newClass project prevMode packageID |
288 |
packageDefinitionClass| |
|
1 | 289 |
|
12252 | 290 |
self == Autoload ifTrue:[ |
291 |
"already loaded" |
|
292 |
^ self. |
|
293 |
]. |
|
294 |
||
164 | 295 |
myName := self name asSymbol. |
3027
7d677a5ced41
care for loaded classes namespace (vs. default namespace)
Claus Gittinger <cg@exept.de>
parents:
2691
diff
changeset
|
296 |
myNameSpace := self nameSpace. |
1 | 297 |
|
9428 | 298 |
(InProgressClasses includes:myName) ifTrue:[ |
9461
791adb50075f
avoid "recursive autoload" error when doing explicit autoload of subclasses
Stefan Vogel <sv@exept.de>
parents:
9428
diff
changeset
|
299 |
"Class is already being loaded. |
791adb50075f
avoid "recursive autoload" error when doing explicit autoload of subclasses
Stefan Vogel <sv@exept.de>
parents:
9428
diff
changeset
|
300 |
In most cases we come here through the path: |
791adb50075f
avoid "recursive autoload" error when doing explicit autoload of subclasses
Stefan Vogel <sv@exept.de>
parents:
9428
diff
changeset
|
301 |
subclass autoload |
791adb50075f
avoid "recursive autoload" error when doing explicit autoload of subclasses
Stefan Vogel <sv@exept.de>
parents:
9428
diff
changeset
|
302 |
-> superclass autoload |
791adb50075f
avoid "recursive autoload" error when doing explicit autoload of subclasses
Stefan Vogel <sv@exept.de>
parents:
9428
diff
changeset
|
303 |
-> superclass initialize/postAutoload |
791adb50075f
avoid "recursive autoload" error when doing explicit autoload of subclasses
Stefan Vogel <sv@exept.de>
parents:
9428
diff
changeset
|
304 |
-> subclass autoload (hardcoded in initialize method). |
791adb50075f
avoid "recursive autoload" error when doing explicit autoload of subclasses
Stefan Vogel <sv@exept.de>
parents:
9428
diff
changeset
|
305 |
Simply ignore it here" |
791adb50075f
avoid "recursive autoload" error when doing explicit autoload of subclasses
Stefan Vogel <sv@exept.de>
parents:
9428
diff
changeset
|
306 |
|
791adb50075f
avoid "recursive autoload" error when doing explicit autoload of subclasses
Stefan Vogel <sv@exept.de>
parents:
9428
diff
changeset
|
307 |
"/ AutoloadFailedSignal |
791adb50075f
avoid "recursive autoload" error when doing explicit autoload of subclasses
Stefan Vogel <sv@exept.de>
parents:
9428
diff
changeset
|
308 |
"/ raiseRequestWith:self |
791adb50075f
avoid "recursive autoload" error when doing explicit autoload of subclasses
Stefan Vogel <sv@exept.de>
parents:
9428
diff
changeset
|
309 |
"/ errorString:('autoload of ' , myName , ' failed (recursive invocation)'). |
791adb50075f
avoid "recursive autoload" error when doing explicit autoload of subclasses
Stefan Vogel <sv@exept.de>
parents:
9428
diff
changeset
|
310 |
|
791adb50075f
avoid "recursive autoload" error when doing explicit autoload of subclasses
Stefan Vogel <sv@exept.de>
parents:
9428
diff
changeset
|
311 |
"self is not yet the loaded class - but it will be after the #become: |
791adb50075f
avoid "recursive autoload" error when doing explicit autoload of subclasses
Stefan Vogel <sv@exept.de>
parents:
9428
diff
changeset
|
312 |
that is done eventually by some sender above." |
791adb50075f
avoid "recursive autoload" error when doing explicit autoload of subclasses
Stefan Vogel <sv@exept.de>
parents:
9428
diff
changeset
|
313 |
^ self. |
9422 | 314 |
]. |
315 |
||
4775 | 316 |
"/ recheck - in case my class somehow came into the system |
317 |
"/ (by loading a binary...) |
|
318 |
(newClass := Smalltalk at:myName) ~~ self ifTrue:[ |
|
6075
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
319 |
(newClass isBehavior and:[newClass isLoaded]) ifTrue:[ |
8588
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
320 |
(Object infoPrinting and:[Smalltalk silentLoading ~~ true]) ifTrue:[ |
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
321 |
Transcript showCR:('Autoload [info]: already loaded: ', myName , '.'); endEntry. |
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
322 |
]. |
6075
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
323 |
self class becomeSameAs:newClass class. |
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
324 |
self becomeSameAs:newClass. |
4775 | 325 |
|
6075
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
326 |
ObjectMemory flushCaches. |
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
327 |
^ newClass |
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
328 |
]. |
4775 | 329 |
]. |
330 |
||
2 | 331 |
"load it" |
1566 | 332 |
(Object infoPrinting and:[Smalltalk silentLoading ~~ true]) ifTrue:[ |
10128 | 333 |
"/ thisContext fullPrintAll. |
6075
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
334 |
Transcript showCR:('autoloading ', myName , ' ...'); endEntry. |
1564
f3f9736bd0fa
suppress load messages, if infoPrinting is turned off
Claus Gittinger <cg@exept.de>
parents:
1438
diff
changeset
|
335 |
]. |
1 | 336 |
|
9554 | 337 |
packageID := self package. |
338 |
"is there a package-definition ?" |
|
339 |
packageDefinitionClass := ProjectDefinition definitionClassForPackage: packageID. |
|
340 |
(packageDefinitionClass notNil) ifTrue:[ |
|
341 |
(packageDefinitionClass ~~ self) ifTrue:[ |
|
342 |
(packageDefinitionClass isBehavior) ifTrue:[ |
|
343 |
(packageDefinitionClass isLoaded) ifFalse:[ |
|
344 |
packageDefinitionClass autoload. |
|
345 |
]. |
|
346 |
]. |
|
347 |
]. |
|
348 |
]. |
|
349 |
||
860
b3ffea40999a
use new becomeSameAs: to migrate to new class.
Claus Gittinger <cg@exept.de>
parents:
789
diff
changeset
|
350 |
[ |
9428 | 351 |
InProgressClasses add:myName. |
5902 | 352 |
|
6075
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
353 |
prevMode := ClassCategoryReader sourceMode. |
8588
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
354 |
"/ no- do not do this; it may lead to trouble ... |
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
355 |
"/ ClassCategoryReader sourceMode:#reference. |
1694
29791fde790e
autoload classes keep source reference
Claus Gittinger <cg@exept.de>
parents:
1674
diff
changeset
|
356 |
|
6075
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
357 |
"/ |
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
358 |
"/ in order to not get a package of private (or whatever), |
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
359 |
"/ temporarily set the currentProject to nil. |
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
360 |
"/ we will later set the classes package to something useful |
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
361 |
"/ |
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
362 |
Project notNil ifTrue:[ |
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
363 |
project := Project current. |
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
364 |
Project setProject:nil. |
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
365 |
]. |
2375
7eb1b35edc33
autoload into Smalltalk nameSpace - by default.
Claus Gittinger <cg@exept.de>
parents:
2366
diff
changeset
|
366 |
|
6075
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
367 |
Class nameSpaceQuerySignal answer:myNameSpace "Smalltalk" |
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
368 |
do:[ |
9554 | 369 |
Class packageQuerySignal answer:packageID |
6075
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
370 |
do:[ |
6081
fedbf974cfe8
dont ask for variable-name conventions while autoloading
Claus Gittinger <cg@exept.de>
parents:
6075
diff
changeset
|
371 |
Class classConventionViolationConfirmationQuerySignal answer:true |
fedbf974cfe8
dont ask for variable-name conventions while autoloading
Claus Gittinger <cg@exept.de>
parents:
6075
diff
changeset
|
372 |
do:[ |
10928 | 373 |
(self classFilename notNil and:[self classFilename asFilename isAbsolute]) ifTrue:[ |
10926
64ffe2fe2340
load of explicitly install-as-autoloaded classes:
Claus Gittinger <cg@exept.de>
parents:
10128
diff
changeset
|
374 |
"/ if filename is absolute, the autoload-class was created by an |
64ffe2fe2340
load of explicitly install-as-autoloaded classes:
Claus Gittinger <cg@exept.de>
parents:
10128
diff
changeset
|
375 |
"/ explicit install-as-autoloaded via the fileBrowser. |
10928 | 376 |
Smalltalk fileIn:self classFilename lazy:false silent:nil. |
10926
64ffe2fe2340
load of explicitly install-as-autoloaded classes:
Claus Gittinger <cg@exept.de>
parents:
10128
diff
changeset
|
377 |
] ifFalse:[ |
64ffe2fe2340
load of explicitly install-as-autoloaded classes:
Claus Gittinger <cg@exept.de>
parents:
10128
diff
changeset
|
378 |
(Smalltalk |
64ffe2fe2340
load of explicitly install-as-autoloaded classes:
Claus Gittinger <cg@exept.de>
parents:
10128
diff
changeset
|
379 |
fileInClass:myName |
64ffe2fe2340
load of explicitly install-as-autoloaded classes:
Claus Gittinger <cg@exept.de>
parents:
10128
diff
changeset
|
380 |
package:packageID |
64ffe2fe2340
load of explicitly install-as-autoloaded classes:
Claus Gittinger <cg@exept.de>
parents:
10128
diff
changeset
|
381 |
initialize:false |
64ffe2fe2340
load of explicitly install-as-autoloaded classes:
Claus Gittinger <cg@exept.de>
parents:
10128
diff
changeset
|
382 |
lazy:LazyLoading |
64ffe2fe2340
load of explicitly install-as-autoloaded classes:
Claus Gittinger <cg@exept.de>
parents:
10128
diff
changeset
|
383 |
silent:nil) |
64ffe2fe2340
load of explicitly install-as-autoloaded classes:
Claus Gittinger <cg@exept.de>
parents:
10128
diff
changeset
|
384 |
isNil ifTrue:[ |
64ffe2fe2340
load of explicitly install-as-autoloaded classes:
Claus Gittinger <cg@exept.de>
parents:
10128
diff
changeset
|
385 |
"/ temporary: try without stx/package prefix |
64ffe2fe2340
load of explicitly install-as-autoloaded classes:
Claus Gittinger <cg@exept.de>
parents:
10128
diff
changeset
|
386 |
"/ this will vanish as soon as source-directory |
64ffe2fe2340
load of explicitly install-as-autoloaded classes:
Claus Gittinger <cg@exept.de>
parents:
10128
diff
changeset
|
387 |
"/ is always guaranteed to contain an stx-subtree |
64ffe2fe2340
load of explicitly install-as-autoloaded classes:
Claus Gittinger <cg@exept.de>
parents:
10128
diff
changeset
|
388 |
((packageID startsWith:'stx/') |
12260 | 389 |
or:[packageID startsWith:'stx:']) ifTrue:[ |
10926
64ffe2fe2340
load of explicitly install-as-autoloaded classes:
Claus Gittinger <cg@exept.de>
parents:
10128
diff
changeset
|
390 |
Smalltalk |
64ffe2fe2340
load of explicitly install-as-autoloaded classes:
Claus Gittinger <cg@exept.de>
parents:
10128
diff
changeset
|
391 |
fileInClass:myName |
64ffe2fe2340
load of explicitly install-as-autoloaded classes:
Claus Gittinger <cg@exept.de>
parents:
10128
diff
changeset
|
392 |
package:(packageID copyFrom:5) |
64ffe2fe2340
load of explicitly install-as-autoloaded classes:
Claus Gittinger <cg@exept.de>
parents:
10128
diff
changeset
|
393 |
initialize:false |
64ffe2fe2340
load of explicitly install-as-autoloaded classes:
Claus Gittinger <cg@exept.de>
parents:
10128
diff
changeset
|
394 |
lazy:LazyLoading |
64ffe2fe2340
load of explicitly install-as-autoloaded classes:
Claus Gittinger <cg@exept.de>
parents:
10128
diff
changeset
|
395 |
silent:nil. |
64ffe2fe2340
load of explicitly install-as-autoloaded classes:
Claus Gittinger <cg@exept.de>
parents:
10128
diff
changeset
|
396 |
] |
6081
fedbf974cfe8
dont ask for variable-name conventions while autoloading
Claus Gittinger <cg@exept.de>
parents:
6075
diff
changeset
|
397 |
] |
6075
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
398 |
] |
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
399 |
] |
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
400 |
] |
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
401 |
]. |
8588
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
402 |
] ensure:[ |
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
403 |
"restore previous state" |
6075
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
404 |
ClassCategoryReader sourceMode:prevMode. |
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
405 |
project notNil ifTrue:[ |
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
406 |
Project setProject:project. |
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
407 |
]. |
9428 | 408 |
InProgressClasses remove:myName ifAbsent:[]. |
860
b3ffea40999a
use new becomeSameAs: to migrate to new class.
Claus Gittinger <cg@exept.de>
parents:
789
diff
changeset
|
409 |
]. |
1 | 410 |
|
8588
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
411 |
" |
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
412 |
NOTE: ClassLoader did already perform a #becomeSameAs: |
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
413 |
of the loaded class to the new class. |
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
414 |
|
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
415 |
So some of the code below is no longer needed. |
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
416 |
" |
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
417 |
|
1 | 418 |
"did it work ?" |
164 | 419 |
newClass := Smalltalk at:myName. |
8588
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
420 |
newClass ~~ self ifTrue:[ |
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
421 |
"reinstall the autoload class, this will be undone by #become:" |
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
422 |
Smalltalk at:myName put:self. |
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
423 |
]. |
1 | 424 |
|
138 | 425 |
"no - report the error" |
8431
3e06c959dcff
#autoload - raise error if fileIn fails.
Stefan Vogel <sv@exept.de>
parents:
8382
diff
changeset
|
426 |
(newClass isNil or:[newClass isLoaded not]) ifTrue:[ |
6075
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
427 |
" |
8588
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
428 |
USER INFORMATION: |
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
429 |
this exception has been raised because an autoloaded class |
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
430 |
could not be loaded. Usually, this happens when |
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
431 |
the classes sourcefile is missing, unreadable or if |
6075
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
432 |
an entry is missing in the abbreviation file. |
8588
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
433 |
|
6075
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
434 |
Check for a readable file named <myName>.st |
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
435 |
in the 'source' directory and (if its a long fileName) |
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
436 |
for a corresponding entry in the abbreviation file |
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
437 |
'include/abbrev.stc'. |
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
438 |
Finally, your searchpath could be set wrong - |
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
439 |
both 'source' and 'include' directories must be found in |
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
440 |
one of the directories named in systemPath. |
154 | 441 |
|
8588
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
442 |
In the debugger, press 'Abort' to continue execution. |
6075
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
443 |
" |
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
444 |
AutoloadFailedSignal |
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
445 |
raiseRequestWith:self |
12791 | 446 |
errorString:('autoload of %1 failed (%2)' |
447 |
bindWith:myName |
|
448 |
with:(newClass isNil ifTrue:['nil result'] ifFalse:['still unloaded'])). |
|
6075
57f3ae8d2a28
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
5903
diff
changeset
|
449 |
^ nil |
938
a23bc7f62ed1
set package info when autoloading
Claus Gittinger <cg@exept.de>
parents:
922
diff
changeset
|
450 |
]. |
a23bc7f62ed1
set package info when autoloading
Claus Gittinger <cg@exept.de>
parents:
922
diff
changeset
|
451 |
|
9554 | 452 |
newClass setPackage:packageID. |
9564 | 453 |
newClass instAndClassSelectorsAndMethodsDo:[:sel :mthd | mthd setPackage:packageID]. |
5527
2817d7e173de
set project of all autoloaded methods
Claus Gittinger <cg@exept.de>
parents:
5475
diff
changeset
|
454 |
|
938
a23bc7f62ed1
set package info when autoloading
Claus Gittinger <cg@exept.de>
parents:
922
diff
changeset
|
455 |
"/ |
a23bc7f62ed1
set package info when autoloading
Claus Gittinger <cg@exept.de>
parents:
922
diff
changeset
|
456 |
"/ autoloaded classes get their package from the revision (if present) |
a23bc7f62ed1
set package info when autoloading
Claus Gittinger <cg@exept.de>
parents:
922
diff
changeset
|
457 |
"/ this only happens with autoloaded sourceFiles which have no package |
a23bc7f62ed1
set package info when autoloading
Claus Gittinger <cg@exept.de>
parents:
922
diff
changeset
|
458 |
"/ info encoded. (binary classes have it) |
2057
35003ed4b817
care for the package ID when autoloading
Claus Gittinger <cg@exept.de>
parents:
2019
diff
changeset
|
459 |
"/ If there is no such information, give it my package (if I have one) |
938
a23bc7f62ed1
set package info when autoloading
Claus Gittinger <cg@exept.de>
parents:
922
diff
changeset
|
460 |
"/ |
5463
18ec3ac68106
preserve the package when autoloading
Claus Gittinger <cg@exept.de>
parents:
5345
diff
changeset
|
461 |
"/ newClass setPackageFromRevision. |
18ec3ac68106
preserve the package when autoloading
Claus Gittinger <cg@exept.de>
parents:
5345
diff
changeset
|
462 |
"/ |
18ec3ac68106
preserve the package when autoloading
Claus Gittinger <cg@exept.de>
parents:
5345
diff
changeset
|
463 |
"/ newPackage := newClass package. |
18ec3ac68106
preserve the package when autoloading
Claus Gittinger <cg@exept.de>
parents:
5345
diff
changeset
|
464 |
"/ (newPackage isNil or:[newPackage = 'no package']) ifTrue:[ |
18ec3ac68106
preserve the package when autoloading
Claus Gittinger <cg@exept.de>
parents:
5345
diff
changeset
|
465 |
"/ (package notNil and:[package ~= 'no package']) ifTrue:[ |
9564 | 466 |
"/ newClass setPackage:packageID. |
5463
18ec3ac68106
preserve the package when autoloading
Claus Gittinger <cg@exept.de>
parents:
5345
diff
changeset
|
467 |
"/ ]. |
18ec3ac68106
preserve the package when autoloading
Claus Gittinger <cg@exept.de>
parents:
5345
diff
changeset
|
468 |
"/ ]. |
1 | 469 |
|
216 | 470 |
|
154 | 471 |
"wow - it worked. now the big trick ..." |
1 | 472 |
|
8588
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
473 |
"/ newClass class setSoleInstance:self. "/ will be undone by become ... |
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
474 |
"/ self setName:(self name , ' (auto)'). |
921
4db7603f9506
rename myself (just in case) & flush caches after loading
Claus Gittinger <cg@exept.de>
parents:
886
diff
changeset
|
475 |
|
8588
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
476 |
Smalltalk changed:#aboutToAutoloadClass with:(self -> newClass). |
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
477 |
newClass ~~ self ifTrue:[ |
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
478 |
self dependents do:[:aDependent | |
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
479 |
newClass addDependent:aDependent |
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
480 |
]. |
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
481 |
self class becomeSameAs:newClass class. |
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
482 |
self becomeSameAs:newClass. |
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
483 |
|
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
484 |
ObjectMemory flushCaches. |
12702 | 485 |
Class flushSubclassInfoFor:self. |
7178 | 486 |
]. |
921
4db7603f9506
rename myself (just in case) & flush caches after loading
Claus Gittinger <cg@exept.de>
parents:
886
diff
changeset
|
487 |
|
8588
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
488 |
"the rehash here is pure superstition" |
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
489 |
LoadedClasses rehash; add:newClass. |
921
4db7603f9506
rename myself (just in case) & flush caches after loading
Claus Gittinger <cg@exept.de>
parents:
886
diff
changeset
|
490 |
|
9520 | 491 |
newClass postAutoload. |
3443
d57ea75d3ac5
oops - must send #initialize to all privateClasses.
Claus Gittinger <cg@exept.de>
parents:
3287
diff
changeset
|
492 |
newClass initializeWithAllPrivateClasses. |
5705
543d3e8ef7c6
send a change notification when autoloading
Claus Gittinger <cg@exept.de>
parents:
5527
diff
changeset
|
493 |
|
543d3e8ef7c6
send a change notification when autoloading
Claus Gittinger <cg@exept.de>
parents:
5527
diff
changeset
|
494 |
Smalltalk changed:#classDefinition with:newClass. |
8588
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
495 |
self changed:#loaded with:newClass. |
886 | 496 |
^ newClass |
938
a23bc7f62ed1
set package info when autoloading
Claus Gittinger <cg@exept.de>
parents:
922
diff
changeset
|
497 |
|
10128 | 498 |
"Modified: / 23-10-2006 / 18:12:21 / cg" |
1 | 499 |
! ! |
500 |
||
1862
e8f44f10f1ab
changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents:
1720
diff
changeset
|
501 |
!Autoload class methodsFor:'message catching'! |
1 | 502 |
|
6251 | 503 |
at:arg |
504 |
"catch at: - redefined because its understood" |
|
505 |
||
8482 | 506 |
^ self doesNotUnderstand:(Message selector:#at: argument:arg) |
6251 | 507 |
! |
508 |
||
620 | 509 |
basicNew |
1277 | 510 |
"catch basicNew - load the class and send it to the real one" |
620 | 511 |
|
512 |
^ self doesNotUnderstand:(Message selector:#basicNew) |
|
1277 | 513 |
|
514 |
"Modified: 24.4.1996 / 19:53:10 / cg" |
|
620 | 515 |
! |
516 |
||
517 |
basicNew:arg |
|
1277 | 518 |
"catch basicNew: - load the class and send it to the real one" |
620 | 519 |
|
8482 | 520 |
^ self doesNotUnderstand:(Message selector:#basicNew: argument:arg) |
1277 | 521 |
|
522 |
"Modified: 24.4.1996 / 19:53:16 / cg" |
|
620 | 523 |
! |
524 |
||
8185 | 525 |
classResources |
8316 | 526 |
"catch classResources - load the class and resend to the real one" |
8185 | 527 |
|
528 |
^ self doesNotUnderstand:(Message selector:#classResources) |
|
529 |
! |
|
530 |
||
620 | 531 |
comment |
532 |
"return the classes comment. |
|
533 |
Autoloaded classes have no comment; but I myself have one" |
|
534 |
||
535 |
(self == Autoload) ifTrue:[^ super comment]. |
|
536 |
^ 'not yet loaded' |
|
537 |
! |
|
538 |
||
6768 | 539 |
copy |
540 |
"catch copy - load the class and resend #copy to the real one" |
|
541 |
||
542 |
^ self doesNotUnderstand:(Message selector:#copy) |
|
543 |
! |
|
544 |
||
1 | 545 |
doesNotUnderstand:aMessage |
2689 | 546 |
"caught a message; load the class and retry the message" |
1 | 547 |
|
548 |
|newClass| |
|
549 |
||
164 | 550 |
self ~~ Autoload ifTrue:[ |
7178 | 551 |
newClass := self autoload. |
10095 | 552 |
(newClass notNil and:[newClass isLoaded]) ifTrue:[ |
7178 | 553 |
^ aMessage sendTo:newClass |
554 |
] |
|
1 | 555 |
]. |
789
155eca125ef0
return value from doesNotUnderstand (so handler can return a value)
Claus Gittinger <cg@exept.de>
parents:
739
diff
changeset
|
556 |
^ super doesNotUnderstand:aMessage |
1277 | 557 |
|
10095 | 558 |
"Modified: / 16-10-2006 / 16:52:20 / cg" |
1 | 559 |
! |
560 |
||
7574 | 561 |
error |
562 |
"catch error - load the class and resend #error to the real one" |
|
563 |
||
564 |
^ self doesNotUnderstand:(Message selector:#error) |
|
565 |
! |
|
566 |
||
8709
25088287bbd0
Catch #fromString: (for autoloaded classes from Dolphin)
Stefan Vogel <sv@exept.de>
parents:
8590
diff
changeset
|
567 |
fromString:aString |
25088287bbd0
Catch #fromString: (for autoloaded classes from Dolphin)
Stefan Vogel <sv@exept.de>
parents:
8590
diff
changeset
|
568 |
"catch - load the class and send it to the real one" |
25088287bbd0
Catch #fromString: (for autoloaded classes from Dolphin)
Stefan Vogel <sv@exept.de>
parents:
8590
diff
changeset
|
569 |
|
25088287bbd0
Catch #fromString: (for autoloaded classes from Dolphin)
Stefan Vogel <sv@exept.de>
parents:
8590
diff
changeset
|
570 |
^ self doesNotUnderstand:(Message selector:#fromString: argument:aString) |
25088287bbd0
Catch #fromString: (for autoloaded classes from Dolphin)
Stefan Vogel <sv@exept.de>
parents:
8590
diff
changeset
|
571 |
! |
25088287bbd0
Catch #fromString: (for autoloaded classes from Dolphin)
Stefan Vogel <sv@exept.de>
parents:
8590
diff
changeset
|
572 |
|
9804 | 573 |
inspectorExtraAttributes |
11951 | 574 |
"extra (pseudo instvar) entries to be shown in an inspector." |
575 |
||
9804 | 576 |
^ #() |
577 |
! |
|
578 |
||
579 |
inspectorExtraNamedFields |
|
580 |
^ #() |
|
581 |
! |
|
582 |
||
1 | 583 |
new |
2663 | 584 |
"catch new - load the class and resend #new to the real one" |
1 | 585 |
|
586 |
^ self doesNotUnderstand:(Message selector:#new) |
|
1277 | 587 |
|
2663 | 588 |
"Modified: 26.5.1997 / 14:59:52 / cg" |
1 | 589 |
! |
590 |
||
591 |
new:arg |
|
2663 | 592 |
"catch new: - load the class and resend #new: it to the real one" |
1 | 593 |
|
8482 | 594 |
^ self doesNotUnderstand:(Message selector:#new: argument:arg) |
1277 | 595 |
|
2663 | 596 |
"Modified: 26.5.1997 / 14:59:58 / cg" |
1 | 597 |
! |
598 |
||
9373
e312f2f2901c
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9218
diff
changeset
|
599 |
privateClassesAt:aClassNameString |
e312f2f2901c
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9218
diff
changeset
|
600 |
"catch - load the class and send it to the real one" |
e312f2f2901c
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9218
diff
changeset
|
601 |
|
e312f2f2901c
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9218
diff
changeset
|
602 |
self == Autoload ifTrue:[ |
e312f2f2901c
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9218
diff
changeset
|
603 |
^ super privateClassesAt:aClassNameString. |
e312f2f2901c
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9218
diff
changeset
|
604 |
]. |
e312f2f2901c
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9218
diff
changeset
|
605 |
^ self doesNotUnderstand:(Message selector:#privateClassesAt: argument:aClassNameString) |
e312f2f2901c
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9218
diff
changeset
|
606 |
! |
e312f2f2901c
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9218
diff
changeset
|
607 |
|
1438
76fdecf85f9e
Catch readFrom: and readFromString: too.
Stefan Vogel <sv@exept.de>
parents:
1437
diff
changeset
|
608 |
readFrom:aStream |
76fdecf85f9e
Catch readFrom: and readFromString: too.
Stefan Vogel <sv@exept.de>
parents:
1437
diff
changeset
|
609 |
"catch - load the class and send it to the real one" |
76fdecf85f9e
Catch readFrom: and readFromString: too.
Stefan Vogel <sv@exept.de>
parents:
1437
diff
changeset
|
610 |
|
8482 | 611 |
^ self doesNotUnderstand:(Message selector:#readFrom: argument:aStream) |
1438
76fdecf85f9e
Catch readFrom: and readFromString: too.
Stefan Vogel <sv@exept.de>
parents:
1437
diff
changeset
|
612 |
|
76fdecf85f9e
Catch readFrom: and readFromString: too.
Stefan Vogel <sv@exept.de>
parents:
1437
diff
changeset
|
613 |
"Created: 22.5.1996 / 23:44:23 / stefan" |
76fdecf85f9e
Catch readFrom: and readFromString: too.
Stefan Vogel <sv@exept.de>
parents:
1437
diff
changeset
|
614 |
! |
76fdecf85f9e
Catch readFrom: and readFromString: too.
Stefan Vogel <sv@exept.de>
parents:
1437
diff
changeset
|
615 |
|
1437 | 616 |
readFrom:aStream onError:exceptionBlock |
617 |
"catch - load the class and send it to the real one" |
|
618 |
||
619 |
^ self doesNotUnderstand:(Message selector:#readFrom:onError: with:aStream with:exceptionBlock) |
|
620 |
||
621 |
"Created: 22.5.1996 / 23:03:39 / stefan" |
|
622 |
! |
|
623 |
||
1438
76fdecf85f9e
Catch readFrom: and readFromString: too.
Stefan Vogel <sv@exept.de>
parents:
1437
diff
changeset
|
624 |
readFromString:aString |
76fdecf85f9e
Catch readFrom: and readFromString: too.
Stefan Vogel <sv@exept.de>
parents:
1437
diff
changeset
|
625 |
"catch - load the class and send it to the real one" |
76fdecf85f9e
Catch readFrom: and readFromString: too.
Stefan Vogel <sv@exept.de>
parents:
1437
diff
changeset
|
626 |
|
8482 | 627 |
^ self doesNotUnderstand:(Message selector:#readFromString: argument:aString) |
1438
76fdecf85f9e
Catch readFrom: and readFromString: too.
Stefan Vogel <sv@exept.de>
parents:
1437
diff
changeset
|
628 |
|
76fdecf85f9e
Catch readFrom: and readFromString: too.
Stefan Vogel <sv@exept.de>
parents:
1437
diff
changeset
|
629 |
"Created: 22.5.1996 / 23:46:15 / stefan" |
76fdecf85f9e
Catch readFrom: and readFromString: too.
Stefan Vogel <sv@exept.de>
parents:
1437
diff
changeset
|
630 |
! |
76fdecf85f9e
Catch readFrom: and readFromString: too.
Stefan Vogel <sv@exept.de>
parents:
1437
diff
changeset
|
631 |
|
1437 | 632 |
readFromString:aString onError:exceptionBlock |
633 |
"catch - load the class and send it to the real one" |
|
634 |
||
635 |
^ self doesNotUnderstand:(Message selector:#readFromString:onError: with:aString with:exceptionBlock) |
|
636 |
||
637 |
"Created: 22.5.1996 / 23:04:49 / stefan" |
|
638 |
! |
|
639 |
||
2691
33221e233f79
when asked via #respondsTo:, load & resend
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
640 |
respondsTo:aSelector |
33221e233f79
when asked via #respondsTo:, load & resend
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
641 |
"catch respondsTo: - load the class and resend #respondsTo: it to the real one" |
33221e233f79
when asked via #respondsTo:, load & resend
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
642 |
|
33221e233f79
when asked via #respondsTo:, load & resend
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
643 |
self == Autoload ifTrue:[ |
7178 | 644 |
^ super respondsTo:aSelector |
2691
33221e233f79
when asked via #respondsTo:, load & resend
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
645 |
]. |
8482 | 646 |
^ self doesNotUnderstand:(Message selector:#respondsTo: argument:aSelector) |
2691
33221e233f79
when asked via #respondsTo:, load & resend
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
647 |
|
33221e233f79
when asked via #respondsTo:, load & resend
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
648 |
"Modified: 26.5.1997 / 14:59:58 / cg" |
8306 | 649 |
! |
650 |
||
11058 | 651 |
value |
652 |
"catch value - load the class and resend #value to the real one" |
|
653 |
||
654 |
^ self doesNotUnderstand:(Message selector:#value) |
|
1 | 655 |
! ! |
11 | 656 |
|
8316 | 657 |
!Autoload class methodsFor:'private'! |
658 |
||
659 |
loadAndResendMessage |
|
660 |
"common helper to autoload a class and define a subclass of it by sending |
|
661 |
the sender-message again. |
|
662 |
This is invoked by all #subClass... definition messages." |
|
663 |
||
664 |
|sel args newClass| |
|
665 |
||
666 |
sel := thisContext sender selector. |
|
667 |
args := thisContext sender args. |
|
668 |
||
669 |
"take care: subclassing Autoload must still be possible" |
|
670 |
(self == Autoload) ifTrue:[ |
|
12260 | 671 |
^ self perform:sel inClass:self class superclass withArguments:args |
8316 | 672 |
]. |
673 |
||
674 |
newClass := self autoload. |
|
675 |
newClass notNil ifTrue:[ |
|
9556 | 676 |
newClass isLoaded ifTrue:[ |
677 |
^ newClass perform:sel withArguments:args |
|
678 |
]. |
|
679 |
Transcript showCR:'Autoload [warning]: failed to autoload ',self name. |
|
8316 | 680 |
]. |
681 |
^ nil |
|
682 |
||
9556 | 683 |
"Created: / 08-02-1997 / 19:42:47 / cg" |
684 |
"Modified: / 17-08-2006 / 11:12:24 / cg" |
|
8316 | 685 |
! ! |
686 |
||
1862
e8f44f10f1ab
changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents:
1720
diff
changeset
|
687 |
!Autoload class methodsFor:'queries'! |
356 | 688 |
|
5902 | 689 |
accepts:aSignal |
8588
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
690 |
"redefined to avoid recursive autoload. |
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
691 |
(#autoload eventually raises QueryExceptions. |
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
692 |
These exception may send #accepts: to exception classes |
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
693 |
that are currently being loaded)" |
5902 | 694 |
|
695 |
|newClass| |
|
696 |
||
697 |
self isBeingLoaded ifFalse:[ |
|
7178 | 698 |
newClass := self autoload. |
699 |
newClass notNil ifTrue:[ |
|
700 |
^ newClass accepts:aSignal |
|
701 |
]. |
|
5902 | 702 |
]. |
703 |
^ false |
|
704 |
! |
|
705 |
||
10928 | 706 |
isAbstract |
707 |
^ true |
|
708 |
! |
|
709 |
||
620 | 710 |
isBehavior |
9218 | 711 |
"return true, if the receiver is describing another objects behavior. |
620 | 712 |
Autoloaded classes are definitely; therefore return true." |
164 | 713 |
|
620 | 714 |
^ true |
715 |
! |
|
356 | 716 |
|
5902 | 717 |
isBeingLoaded |
8588
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
718 |
"answer true if the class loading is currently in process" |
4bf5e572f5d9
Fix recursive autoloading of exception classes.
Stefan Vogel <sv@exept.de>
parents:
8482
diff
changeset
|
719 |
|
9461
791adb50075f
avoid "recursive autoload" error when doing explicit autoload of subclasses
Stefan Vogel <sv@exept.de>
parents:
9428
diff
changeset
|
720 |
^ (self ~~ Autoload) and:[InProgressClasses includes:self name asSymbol] |
5902 | 721 |
|
722 |
"Modified: / 16.2.1998 / 11:57:35 / stefan" |
|
723 |
! |
|
724 |
||
729 | 725 |
isBuiltInClass |
1266 | 726 |
"return true if this class is known by the run-time-system. |
727 |
Returns false here." |
|
728 |
||
729 | 729 |
^ false |
730 |
||
731 |
"Created: 10.12.1995 / 00:28:22 / cg" |
|
1266 | 732 |
"Modified: 23.4.1996 / 15:55:36 / cg" |
729 | 733 |
! |
734 |
||
620 | 735 |
isLoaded |
3287 | 736 |
"return true, if the class has been loaded. |
737 |
Autoload itself is loaded, subclasses are not. |
|
738 |
This allows testing wether a class has already been loaded." |
|
620 | 739 |
|
740 |
^ (self == Autoload) |
|
3287 | 741 |
|
742 |
"Modified: / 16.2.1998 / 11:57:35 / stefan" |
|
620 | 743 |
! |
744 |
||
922 | 745 |
loadedClasses |
746 |
"return the set of classes that were autoloaded" |
|
747 |
||
8316 | 748 |
^ LoadedClasses |
922 | 749 |
! |
750 |
||
4401
d9667432d35b
privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4301
diff
changeset
|
751 |
privateClassesOrAll:allOfThem |
4000 | 752 |
"an autoloaded class has none" |
753 |
||
754 |
^ #() |
|
755 |
! |
|
756 |
||
620 | 757 |
wasAutoloaded:aClass |
922 | 758 |
"return true, if aClass was autoloaded" |
759 |
||
8316 | 760 |
^ LoadedClasses includes:aClass |
11 | 761 |
! ! |
620 | 762 |
|
13288
c525954778c6
added: #withClass:loadedDo:
Claus Gittinger <cg@exept.de>
parents:
12791
diff
changeset
|
763 |
!Autoload class methodsFor:'utilities'! |
c525954778c6
added: #withClass:loadedDo:
Claus Gittinger <cg@exept.de>
parents:
12791
diff
changeset
|
764 |
|
c525954778c6
added: #withClass:loadedDo:
Claus Gittinger <cg@exept.de>
parents:
12791
diff
changeset
|
765 |
withClass:aClass loadedDo:aBlock |
c525954778c6
added: #withClass:loadedDo:
Claus Gittinger <cg@exept.de>
parents:
12791
diff
changeset
|
766 |
"ensure that aClass is loaded, while evaluating aBlock for it" |
c525954778c6
added: #withClass:loadedDo:
Claus Gittinger <cg@exept.de>
parents:
12791
diff
changeset
|
767 |
|
c525954778c6
added: #withClass:loadedDo:
Claus Gittinger <cg@exept.de>
parents:
12791
diff
changeset
|
768 |
|wasLoaded loadedClass| |
c525954778c6
added: #withClass:loadedDo:
Claus Gittinger <cg@exept.de>
parents:
12791
diff
changeset
|
769 |
|
c525954778c6
added: #withClass:loadedDo:
Claus Gittinger <cg@exept.de>
parents:
12791
diff
changeset
|
770 |
wasLoaded := aClass isLoaded. |
c525954778c6
added: #withClass:loadedDo:
Claus Gittinger <cg@exept.de>
parents:
12791
diff
changeset
|
771 |
wasLoaded ifTrue:[ |
c525954778c6
added: #withClass:loadedDo:
Claus Gittinger <cg@exept.de>
parents:
12791
diff
changeset
|
772 |
^ aBlock value:aClass |
c525954778c6
added: #withClass:loadedDo:
Claus Gittinger <cg@exept.de>
parents:
12791
diff
changeset
|
773 |
]. |
c525954778c6
added: #withClass:loadedDo:
Claus Gittinger <cg@exept.de>
parents:
12791
diff
changeset
|
774 |
|
c525954778c6
added: #withClass:loadedDo:
Claus Gittinger <cg@exept.de>
parents:
12791
diff
changeset
|
775 |
ParserFlags |
c525954778c6
added: #withClass:loadedDo:
Claus Gittinger <cg@exept.de>
parents:
12791
diff
changeset
|
776 |
withSTCCompilation:#never |
c525954778c6
added: #withClass:loadedDo:
Claus Gittinger <cg@exept.de>
parents:
12791
diff
changeset
|
777 |
do:[ |
c525954778c6
added: #withClass:loadedDo:
Claus Gittinger <cg@exept.de>
parents:
12791
diff
changeset
|
778 |
loadedClass := aClass autoload. |
c525954778c6
added: #withClass:loadedDo:
Claus Gittinger <cg@exept.de>
parents:
12791
diff
changeset
|
779 |
]. |
c525954778c6
added: #withClass:loadedDo:
Claus Gittinger <cg@exept.de>
parents:
12791
diff
changeset
|
780 |
|
c525954778c6
added: #withClass:loadedDo:
Claus Gittinger <cg@exept.de>
parents:
12791
diff
changeset
|
781 |
|
c525954778c6
added: #withClass:loadedDo:
Claus Gittinger <cg@exept.de>
parents:
12791
diff
changeset
|
782 |
^ [ |
c525954778c6
added: #withClass:loadedDo:
Claus Gittinger <cg@exept.de>
parents:
12791
diff
changeset
|
783 |
aBlock value:loadedClass |
c525954778c6
added: #withClass:loadedDo:
Claus Gittinger <cg@exept.de>
parents:
12791
diff
changeset
|
784 |
] ensure:[ |
c525954778c6
added: #withClass:loadedDo:
Claus Gittinger <cg@exept.de>
parents:
12791
diff
changeset
|
785 |
aClass unload |
c525954778c6
added: #withClass:loadedDo:
Claus Gittinger <cg@exept.de>
parents:
12791
diff
changeset
|
786 |
] |
c525954778c6
added: #withClass:loadedDo:
Claus Gittinger <cg@exept.de>
parents:
12791
diff
changeset
|
787 |
|
c525954778c6
added: #withClass:loadedDo:
Claus Gittinger <cg@exept.de>
parents:
12791
diff
changeset
|
788 |
" |
c525954778c6
added: #withClass:loadedDo:
Claus Gittinger <cg@exept.de>
parents:
12791
diff
changeset
|
789 |
Autoload withClass:Array loadedDo:[:cls | self assert:cls isLoaded] |
c525954778c6
added: #withClass:loadedDo:
Claus Gittinger <cg@exept.de>
parents:
12791
diff
changeset
|
790 |
Autoload withClass:Cons loadedDo:[:cls | self assert:cls isLoaded] |
c525954778c6
added: #withClass:loadedDo:
Claus Gittinger <cg@exept.de>
parents:
12791
diff
changeset
|
791 |
" |
c525954778c6
added: #withClass:loadedDo:
Claus Gittinger <cg@exept.de>
parents:
12791
diff
changeset
|
792 |
|
c525954778c6
added: #withClass:loadedDo:
Claus Gittinger <cg@exept.de>
parents:
12791
diff
changeset
|
793 |
"Created: / 08-02-2011 / 20:01:32 / cg" |
c525954778c6
added: #withClass:loadedDo:
Claus Gittinger <cg@exept.de>
parents:
12791
diff
changeset
|
794 |
! ! |
c525954778c6
added: #withClass:loadedDo:
Claus Gittinger <cg@exept.de>
parents:
12791
diff
changeset
|
795 |
|
1862
e8f44f10f1ab
changes for new #infoOf: / #linkInfoOf: return
Claus Gittinger <cg@exept.de>
parents:
1720
diff
changeset
|
796 |
!Autoload class methodsFor:'documentation'! |
661 | 797 |
|
798 |
version |
|
14410
3c6d55f3bada
changed: #basicFileOutDefinitionOn:withNameSpace:withPackage:
Claus Gittinger <cg@exept.de>
parents:
13288
diff
changeset
|
799 |
^ '$Header: /cvs/stx/stx/libbasic/Autoload.st,v 1.159 2012-10-20 19:50:23 cg Exp $' |
12074 | 800 |
! |
801 |
||
802 |
version_CVS |
|
14410
3c6d55f3bada
changed: #basicFileOutDefinitionOn:withNameSpace:withPackage:
Claus Gittinger <cg@exept.de>
parents:
13288
diff
changeset
|
803 |
^ '$Header: /cvs/stx/stx/libbasic/Autoload.st,v 1.159 2012-10-20 19:50:23 cg Exp $' |
661 | 804 |
! ! |
6768 | 805 |
|
620 | 806 |
Autoload initialize! |