author | Claus Gittinger <cg@exept.de> |
Mon, 13 Oct 1997 14:58:55 +0200 | |
changeset 3022 | 1b6800d56d62 |
parent 3021 | 00e0308cda7c |
child 3025 | 53b114d5be3e |
permissions | -rw-r--r-- |
1 | 1 |
" |
5 | 2 |
COPYRIGHT (c) 1988 by Claus Gittinger |
2379 | 3 |
All Rights Reserved |
1 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
2907 | 13 |
'From Smalltalk/X, Version:3.1.9 on 8-sep-1997 at 12:44:51 am' ! |
2894 | 14 |
|
1 | 15 |
Object subclass:#Smalltalk |
2405
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
16 |
instanceVariableNames:'' |
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
17 |
classVariableNames:'StartBlocks ImageStartBlocks ExitBlocks CachedClasses SystemPath |
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
18 |
StartupClass StartupSelector StartupArguments CommandLine |
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
19 |
CommandLineArguments CachedAbbreviations SilentLoading |
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
20 |
Initializing StandAlone LogDoits LoadBinaries RealSystemPath |
2928 | 21 |
ResourcePath SourcePath BitmapPath BinaryPath FileInPath |
22 |
BinaryDirName ResourceDirName SourceDirName BitmapDirName |
|
23 |
FileInDirName ChangeFileName |
|
2844
a57a4b8ca9e9
preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
24 |
ImageStartTime ImageRestartTime DemoMode SyntaxHilighting' |
2405
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
25 |
poolDictionaries:'' |
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
26 |
category:'System-Support' |
1 | 27 |
! |
28 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
29 |
!Smalltalk class methodsFor:'documentation'! |
70 | 30 |
|
617 | 31 |
copyright |
32 |
" |
|
33 |
COPYRIGHT (c) 1988 by Claus Gittinger |
|
2379 | 34 |
All Rights Reserved |
617 | 35 |
|
36 |
This software is furnished under a license and may be used |
|
37 |
only in accordance with the terms of that license and with the |
|
38 |
inclusion of the above copyright notice. This software may not |
|
39 |
be provided or otherwise made available to, or used by, any |
|
40 |
other person. No title to or ownership of the software is |
|
41 |
hereby transferred. |
|
42 |
" |
|
95 | 43 |
! |
44 |
||
70 | 45 |
documentation |
46 |
" |
|
47 |
This is one of the central classes in the system; |
|
48 |
it provides all system-startup, shutdown and maintenance support. |
|
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
49 |
Also global variables are (conceptionally) kept here. |
70 | 50 |
|
51 |
As you will notice, this is NOT a Dictionary |
|
52 |
- my implementation of globals is totally different |
|
53 |
(due to the need to be able to access globals from c-code as well). |
|
54 |
However, it provides the known enumeration protocol. |
|
55 |
It may change to become a subclass of collection at some time ... |
|
56 |
||
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
57 |
|
1286 | 58 |
[Instance variables:] |
2379 | 59 |
none - all handling is done in the VM |
1286 | 60 |
|
61 |
[Class variables:] |
|
62 |
||
2379 | 63 |
StartBlocks <Collection> blocks to be executed in a separate process after |
64 |
everything has been initialized. These blocks will |
|
65 |
be deleted after execution and therefore not be |
|
66 |
executed after an image restart. Initial processes |
|
67 |
are usually started here. |
|
68 |
||
69 |
ImageStartBlocks |
|
70 |
<Collection> blocks to be executed in a separate process after |
|
71 |
everything has been initialized. These blocks will be |
|
72 |
executed after an image restart. |
|
73 |
||
74 |
ExitBlocks <Collection> blocks to evaluate before system is |
|
75 |
left. Not currently used (GNU-ST compatibility). |
|
76 |
||
77 |
SystemPath <Collection> path to search for system files (sources, bitmaps etc) |
|
78 |
Set to a default here, but typically changed from some |
|
79 |
startup.rc file |
|
80 |
||
81 |
StartupClass <Class> |
|
82 |
StartupSelector <Symbol> |
|
83 |
StartupArguments <Array> |
|
84 |
class and selector, where the system starts up |
|
85 |
(right after VM initialization) |
|
86 |
If an image is saved while this is nonNil, the image will come up |
|
87 |
there. |
|
88 |
||
89 |
CommandLineArguments <Array> command line broken into words |
|
90 |
||
91 |
SilentLoading <Boolean> suppresses messages during fileIn and in compiler |
|
92 |
(can be set to true from a customized main) |
|
93 |
||
94 |
LogDoits <Boolean> if true, doits are also logged in the changes |
|
95 |
file. Default is false, since the changes file |
|
96 |
may become huge if every tiny doIt is saved there ... |
|
97 |
||
98 |
LoadBinaries <Boolean> if true, we attempt to load classes rom a binary |
|
99 |
file, if present. If false, this is always suppressed. |
|
100 |
||
101 |
ImageStartTime <AbsoluteTime> timestamp when this system was started the very first time |
|
102 |
(i.e. the time of the initial start without an image) |
|
103 |
||
104 |
ImageRestartTime |
|
105 |
<AbsoluteTIme> timestamp when this image was started |
|
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
106 |
|
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
107 |
|
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
108 |
|
1650
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
109 |
|
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
110 |
strictly private classVariables (helpers): |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
111 |
|
2379 | 112 |
CachedClasses <Collection> known classes (cached for faster class enumeration) |
113 |
||
114 |
CachedAbbreviations |
|
115 |
<Dictionary> className to filename mappings |
|
116 |
||
117 |
SourcePath <Collection> cached names of really existing directories |
|
118 |
BitmapPath These are remembered, since in NFS systems, |
|
119 |
ResourcePath the time to lookup files may become long |
|
120 |
BinaryPath (especially, if some directories are on machines |
|
121 |
FileInPath which are not up ...). Therefore, the set of really |
|
122 |
existing directories is cached when the SystemPath |
|
123 |
is walked the first time. |
|
1286 | 124 |
|
125 |
[author:] |
|
2379 | 126 |
Claus Gittinger |
70 | 127 |
" |
1 | 128 |
! ! |
129 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
130 |
!Smalltalk class methodsFor:'initialization'! |
1 | 131 |
|
617 | 132 |
initGlobalsFromEnvironment |
133 |
"setup globals from the shell-environment" |
|
134 |
||
135 |
|envString i langString terrString| |
|
136 |
||
137 |
" |
|
138 |
extract Language and LanguageTerritory from LANG variable. |
|
994
6163ae7aaf9b
territory defaults to #us (instead of #usa)
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
139 |
valid are for example: english_us / us_us / us |
2379 | 140 |
english / en_en / en |
141 |
german / de_de / de |
|
142 |
german_austria |
|
617 | 143 |
" |
144 |
||
145 |
Language := #english. |
|
994
6163ae7aaf9b
territory defaults to #us (instead of #usa)
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
146 |
LanguageTerritory := #us. |
617 | 147 |
|
148 |
envString := OperatingSystem getEnvironment:'LANG'. |
|
149 |
envString notNil ifTrue:[ |
|
2379 | 150 |
envString isEmpty ifFalse:[ |
151 |
i := envString indexOf:$_. |
|
152 |
(i == 0) ifTrue:[ |
|
153 |
langString := envString. |
|
154 |
terrString := envString |
|
155 |
] ifFalse:[ |
|
156 |
langString := envString copyTo:(i - 1). |
|
157 |
terrString := envString copyFrom:(i + 1) |
|
158 |
]. |
|
159 |
Language := langString asLowercase asSymbol. |
|
160 |
LanguageTerritory := terrString asLowercase asSymbol |
|
161 |
] |
|
617 | 162 |
]. |
163 |
||
164 |
" |
|
165 |
Smalltalk initGlobalsFromEnvironment |
|
166 |
" |
|
994
6163ae7aaf9b
territory defaults to #us (instead of #usa)
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
167 |
|
6163ae7aaf9b
territory defaults to #us (instead of #usa)
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
168 |
"Modified: 22.2.1996 / 16:59:12 / cg" |
617 | 169 |
! |
170 |
||
171 |
initInterrupts |
|
172 |
"initialize interrupts" |
|
173 |
||
174 |
OperatingSystem enableUserInterrupts. |
|
175 |
OperatingSystem enableHardSignalInterrupts. |
|
176 |
||
177 |
ObjectMemory userInterruptHandler:self. |
|
178 |
ObjectMemory signalInterruptHandler:self. |
|
179 |
ObjectMemory recursionInterruptHandler:self. |
|
180 |
||
963
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
181 |
" |
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
182 |
Smalltalk initInterrupts |
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
183 |
" |
2873
5bc8c81c4a34
Catch fpExeceptionInterrupt after image restart.
Stefan Vogel <sv@exept.de>
parents:
2844
diff
changeset
|
184 |
|
5bc8c81c4a34
Catch fpExeceptionInterrupt after image restart.
Stefan Vogel <sv@exept.de>
parents:
2844
diff
changeset
|
185 |
"Modified: 20.8.1997 / 09:35:49 / stefan" |
617 | 186 |
! |
187 |
||
188 |
initStandardStreams |
|
189 |
"initialize some well-known streams" |
|
190 |
||
191 |
Stdout := NonPositionableExternalStream forStdout. |
|
192 |
Stderr := NonPositionableExternalStream forStderr. |
|
193 |
Stdin := NonPositionableExternalStream forStdin. |
|
194 |
Printer := PrinterStream. |
|
195 |
Transcript := Stderr |
|
196 |
||
963
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
197 |
" |
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
198 |
Smalltalk initStandardStreams |
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
199 |
" |
617 | 200 |
! |
201 |
||
202 |
initStandardTools |
|
203 |
"predefine some tools which we will need later |
|
204 |
- if the view-classes exist, |
|
205 |
they will redefine Inspector and Debugger for graphical interfaces" |
|
206 |
||
207 |
"redefine debug-tools, if view-classes exist" |
|
208 |
||
209 |
Display notNil ifTrue:[ |
|
2379 | 210 |
InspectorView notNil ifTrue:[ |
211 |
Inspector := InspectorView |
|
212 |
]. |
|
213 |
DebugView notNil ifTrue:[ |
|
214 |
Debugger := DebugView |
|
215 |
]. |
|
216 |
Display initialize |
|
617 | 217 |
] |
963
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
218 |
|
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
219 |
" |
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
220 |
Smalltalk initStandardTools |
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
221 |
" |
617 | 222 |
! |
223 |
||
224 |
initSystemPath |
|
225 |
"setup path where system files are searched for. |
|
226 |
the default path is set to: |
|
2379 | 227 |
. |
228 |
.. |
|
229 |
$HOME (if defined) |
|
230 |
$HOME/.smalltalk (if defined & existing) |
|
231 |
$SMALLTALK_LIBDIR (if defined & existing) |
|
232 |
$STX_LIBDIR (if defined & existing) |
|
233 |
/usr/local/lib/smalltalk (if existing) |
|
234 |
/usr/lib/smalltalk (if existing) |
|
617 | 235 |
|
236 |
of course, it is possible to add entries from the 'smalltalk.rc' |
|
237 |
startup file; add expressions such as: |
|
2379 | 238 |
Smalltalk systemPath addFirst:'/foo/bar/baz'. |
239 |
or: |
|
240 |
Smalltalk systemPath addLast:'/fee/foe/foo'. |
|
617 | 241 |
" |
242 |
||
2912 | 243 |
|p homePath userPrivateSTXDir| |
617 | 244 |
|
2928 | 245 |
ChangeFileName := 'changes'. |
246 |
OperatingSystem isVMSlike ifTrue:[ |
|
247 |
BitmapDirName := 'bitmaps.dir'. |
|
248 |
BinaryDirName := 'binary.dir'. |
|
249 |
SourceDirName := 'source.dir'. |
|
250 |
ResourceDirName := 'resources.dir'. |
|
251 |
FileInDirName := 'filein.dir'. |
|
252 |
] ifFalse:[ |
|
253 |
BitmapDirName := 'bitmaps'. |
|
254 |
BinaryDirName := 'binary'. |
|
255 |
SourceDirName := 'source'. |
|
256 |
ResourceDirName := 'resources'. |
|
257 |
FileInDirName := 'fileIn'. |
|
258 |
]. |
|
259 |
||
680 | 260 |
SystemPath isNil ifTrue:[ |
2379 | 261 |
homePath := OperatingSystem getHomeDirectory. |
262 |
homePath isNil ifTrue:[ |
|
2912 | 263 |
homePath := Filename currentDirectory name |
2379 | 264 |
]. |
265 |
||
266 |
" |
|
267 |
the path is set to search files first locally |
|
268 |
- this allows private stuff to override global stuff |
|
269 |
" |
|
270 |
SystemPath := OrderedCollection new. |
|
2928 | 271 |
"/ |
272 |
"/ the current (default) directory |
|
273 |
"/ |
|
2912 | 274 |
SystemPath add:(Filename currentDirectory name). |
275 |
OperatingSystem isVMSlike ifFalse:[ |
|
276 |
SystemPath add:'..'. |
|
277 |
]. |
|
2928 | 278 |
"/ |
279 |
"/ the users home (login) directory |
|
280 |
"/ |
|
2379 | 281 |
SystemPath add:homePath. |
2928 | 282 |
"/ |
283 |
"/ a users private smalltalk directory in its home (login) directory |
|
284 |
"/ |
|
285 |
OperatingSystem isUNIXlike ifTrue:[ |
|
286 |
userPrivateSTXDir := homePath asFilename constructString:'.smalltalk'. |
|
287 |
] ifFalse:[ |
|
288 |
userPrivateSTXDir := homePath asFilename constructString:'smalltalk'. |
|
289 |
]. |
|
290 |
(userPrivateSTXDir asFilename isDirectory) ifTrue:[ |
|
2912 | 291 |
SystemPath add:userPrivateSTXDir |
2379 | 292 |
]. |
2928 | 293 |
"/ |
294 |
"/ SMALLTALK_LIBDIR and/or STX_LIBDIR from the environment |
|
295 |
"/ |
|
2379 | 296 |
p := OperatingSystem getEnvironment:'SMALLTALK_LIBDIR'. |
297 |
p notNil ifTrue:[ |
|
298 |
SystemPath add:p |
|
299 |
]. |
|
300 |
p := OperatingSystem getEnvironment:'STX_LIBDIR'. |
|
301 |
p notNil ifTrue:[ |
|
302 |
SystemPath add:p |
|
303 |
]. |
|
2928 | 304 |
"/ |
305 |
"/ standard locations: |
|
306 |
"/ UNIX: |
|
307 |
"/ /usr/local/lib/smalltalk |
|
308 |
"/ /usr/lib/smalltalk |
|
309 |
"/ VMS: |
|
310 |
"/ stx$root:[lib] |
|
311 |
"/ stx$lib: |
|
312 |
"/ MSDOS: |
|
313 |
"/ \smalltalk (this will change to ...Programs\Smalltalk) |
|
314 |
"/ |
|
2912 | 315 |
OperatingSystem isVMSlike ifTrue:[ |
2928 | 316 |
SystemPath add:'stx$lib:'. |
317 |
SystemPath add:'stx$root:[lib]'. |
|
2912 | 318 |
SystemPath add:'stx$root:'. |
319 |
] ifFalse:[ |
|
2928 | 320 |
OperatingSystem isUNIXlike ifTrue:[ |
321 |
('/usr/local/lib/smalltalk' asFilename isDirectory) ifTrue:[ |
|
322 |
SystemPath add:'/usr/local/lib/smalltalk' |
|
323 |
]. |
|
324 |
('/usr/lib/smalltalk' asFilename isDirectory) ifTrue:[ |
|
325 |
SystemPath add:'/usr/lib/smalltalk' |
|
326 |
]. |
|
327 |
] ifFalse:[ |
|
328 |
('\smalltalk' asFilename isDirectory) ifTrue:[ |
|
329 |
SystemPath add:'\smalltalk' |
|
330 |
] |
|
331 |
] |
|
2379 | 332 |
]. |
333 |
self flushPathCaches |
|
680 | 334 |
] |
617 | 335 |
|
336 |
" |
|
337 |
Smalltalk initSystemPath |
|
338 |
Smalltalk systemPath |
|
339 |
" |
|
340 |
! |
|
341 |
||
342 |
initUserPreferences |
|
343 |
"setup other stuff" |
|
344 |
||
345 |
LogDoits := false. |
|
346 |
LoadBinaries := false. |
|
2844
a57a4b8ca9e9
preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
347 |
SyntaxHilighting := false. |
a57a4b8ca9e9
preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
348 |
|
a57a4b8ca9e9
preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
349 |
"Modified: 8.8.1997 / 10:55:03 / cg" |
617 | 350 |
! |
351 |
||
352 |
initializeModules |
|
353 |
"perform module specific initialization and |
|
354 |
send #initialize to all classes. |
|
355 |
Notice: this is not called when an image is restarted" |
|
356 |
%{ |
|
1688
8a42db1eea60
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
1682
diff
changeset
|
357 |
__init_registered_modules__(3); |
1481 | 358 |
@global(DemoMode) = __getDemoMode() ? true : false; |
617 | 359 |
%} |
360 |
! |
|
361 |
||
325 | 362 |
initializeSystem |
24 | 363 |
"initialize all other classes; setup dispatcher processes etc. |
211 | 364 |
This one is the first entry into the smalltalk world right after startup, |
365 |
ususally followed by Smalltalk>>start. |
|
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
366 |
Notice: |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
367 |
this is not called when an image is restarted; in this |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
368 |
case the show starts in Smalltalk>>restart." |
211 | 369 |
|
348 | 370 |
SilentLoading := false. |
371 |
Initializing := true. |
|
372 |
||
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
373 |
"/ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
374 |
"/ define low-level debugging tools - graphical classes are not prepared yet |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
375 |
"/ to handle things. |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
376 |
"/ This will bring us into the MiniDebugger when an error occurs |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
377 |
"/ during startup |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
378 |
"/ |
211 | 379 |
Inspector := MiniInspector. |
380 |
Debugger := MiniDebugger. |
|
1 | 381 |
|
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
382 |
"/ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
383 |
"/ start catching SIGSEGV and SIGBUS |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
384 |
"/ |
713
32540afb8ffc
setup SIGSEGV/SIGBUS handling early - to catch those during startup
Claus Gittinger <cg@exept.de>
parents:
706
diff
changeset
|
385 |
OperatingSystem enableHardSignalInterrupts. |
32540afb8ffc
setup SIGSEGV/SIGBUS handling early - to catch those during startup
Claus Gittinger <cg@exept.de>
parents:
706
diff
changeset
|
386 |
|
1 | 387 |
self initGlobalsFromEnvironment. |
388 |
||
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
389 |
"/ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
390 |
"/ sorry - there are some, which MUST be initialized before .. |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
391 |
"/ reason: if any error happens during init, we need Signals, Stdout etc. to be there |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
392 |
"/ |
1 | 393 |
Object initialize. |
423 | 394 |
Signal initialize. |
2907 | 395 |
Filename initialize. |
326 | 396 |
ObjectMemory initialize. |
2504
ece15ffbcb69
Initialize OperatingSystem early (needed for some signals).
Stefan Vogel <sv@exept.de>
parents:
2485
diff
changeset
|
397 |
OperatingSystem initialize. |
596
ecb1d732dade
require Stream to be initialized before ExternalStream is
Claus Gittinger <cg@exept.de>
parents:
592
diff
changeset
|
398 |
Stream initialize. |
1 | 399 |
ExternalStream initialize. |
211 | 400 |
|
401 |
self initStandardStreams. "/ setup Stdin, Stdout etc. |
|
1 | 402 |
|
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
403 |
"/ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
404 |
"/ sorry, path must be set before ... |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
405 |
"/ reason: some classes need it during initialize (they might need resources, bitmaps etc) |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
406 |
"/ |
1 | 407 |
self initSystemPath. |
408 |
||
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
409 |
"/ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
410 |
"/ must init display here - some classes (Color, Form) need it during initialize |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
411 |
"/" |
1 | 412 |
Workstation notNil ifTrue:[ |
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
413 |
Workstation initialize |
1 | 414 |
]. |
415 |
||
416 |
Compiler := ByteCodeCompiler. |
|
417 |
Compiler isNil ifTrue:[ |
|
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
418 |
" |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
419 |
ByteCodeCompiler is not in the system (i.e. has not been linked in) |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
420 |
this allows at least immediate evaluations for runtime systems without compiler |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
421 |
NOTICE: a parser is always needed, otherwise we cannot read resource files etc. |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
422 |
" |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
423 |
Compiler := Parser |
1 | 424 |
]. |
425 |
||
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
426 |
"/ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
427 |
"/ another one, to be initialized before others |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
428 |
"/ |
2077
6b5dc412dd15
must initialize Processor before doing modulInits
Claus Gittinger <cg@exept.de>
parents:
2076
diff
changeset
|
429 |
ProcessorScheduler initialize. |
6b5dc412dd15
must initialize Processor before doing modulInits
Claus Gittinger <cg@exept.de>
parents:
2076
diff
changeset
|
430 |
|
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
431 |
"/ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
432 |
"/ now, finally, initialize all other classes |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
433 |
"/ |
325 | 434 |
self initializeModules. |
435 |
||
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
436 |
ImageStartTime := AbsoluteTime now. |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
437 |
|
321 | 438 |
Display notNil ifTrue:[ |
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
439 |
Display initialize. |
2907 | 440 |
Display initializeDeviceResources. |
321 | 441 |
]. |
70 | 442 |
self initInterrupts. |
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
443 |
self initUserPreferences. |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
444 |
|
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
445 |
"/ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
446 |
"/ give classes a chance to perform 2nd-level initialization |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
447 |
"/ now, we are certain, that all other classes have been initialized |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
448 |
"/ (especially: streams and signals can now be used) |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
449 |
"/ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
450 |
ObjectMemory changed:#initialized. |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
451 |
|
2504
ece15ffbcb69
Initialize OperatingSystem early (needed for some signals).
Stefan Vogel <sv@exept.de>
parents:
2485
diff
changeset
|
452 |
"Modified: 8.1.1997 / 19:58:12 / stefan" |
2907 | 453 |
"Modified: 7.9.1997 / 23:34:44 / cg" |
325 | 454 |
! |
1 | 455 |
|
617 | 456 |
isInitialized |
457 |
"this returns true, if the system is properly initialized; |
|
458 |
i.e. false during startup. Especially, the whole viewing stuff is |
|
459 |
not working correctly until initialized." |
|
460 |
||
461 |
^ Initializing not |
|
1 | 462 |
! |
463 |
||
477
8710aba7876b
oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents:
457
diff
changeset
|
464 |
reinitStandardStreams |
8710aba7876b
oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents:
457
diff
changeset
|
465 |
"reinitialize some well-known streams. |
8710aba7876b
oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents:
457
diff
changeset
|
466 |
Tis must be done very early during startup, to allow for |
8710aba7876b
oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents:
457
diff
changeset
|
467 |
debug and trace messages to be output |
8710aba7876b
oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents:
457
diff
changeset
|
468 |
(otherwise, the file-descriptors are invalid)" |
8710aba7876b
oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents:
457
diff
changeset
|
469 |
|
8710aba7876b
oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents:
457
diff
changeset
|
470 |
Stdout reOpen. Stderr reOpen. Stdin reOpen. |
161 | 471 |
! ! |
472 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
473 |
!Smalltalk class methodsFor:'accessing'! |
453 | 474 |
|
475 |
at:aKey |
|
476 |
"retrieve the value stored under aKey, a symbol. |
|
1956 | 477 |
Return nil if not present |
478 |
(this will be changed to trigger an error - better use #at:ifAbsent:)" |
|
453 | 479 |
|
480 |
%{ /* NOCONTEXT */ |
|
481 |
RETURN ( __GLOBAL_GET(aKey) ); |
|
482 |
%} |
|
483 |
! |
|
484 |
||
485 |
at:aKey ifAbsent:aBlock |
|
486 |
"retrieve the value stored at aKey. |
|
487 |
If there is nothing stored under this key, return the value of |
|
488 |
the evaluation of aBlock." |
|
489 |
||
490 |
(self includesKey:aKey) ifTrue:[ |
|
2379 | 491 |
^ self at:aKey |
453 | 492 |
]. |
493 |
^ aBlock value |
|
494 |
||
495 |
" |
|
496 |
Smalltalk at:#fooBar <- returns nil |
|
497 |
Smalltalk at:#fooBar ifAbsent:['sorry'] <- no error |
|
498 |
" |
|
499 |
! |
|
500 |
||
501 |
at:aKey put:aValue |
|
1222 | 502 |
"store the argument aValue under aKey, a symbol. |
503 |
Return aValue (sigh)." |
|
453 | 504 |
|
505 |
|oldValue| |
|
506 |
||
507 |
%{ |
|
508 |
oldValue = __GLOBAL_SET(aKey, aValue, (OBJ *)0); |
|
509 |
%}. |
|
510 |
CachedClasses notNil ifTrue:[ |
|
2379 | 511 |
oldValue isBehavior ifTrue:[ |
512 |
oldValue name == aKey ifTrue:[ |
|
513 |
CachedClasses remove:oldValue ifAbsent:[] |
|
514 |
] |
|
515 |
]. |
|
516 |
aValue isBehavior ifTrue:[ |
|
1956 | 517 |
"/ aValue isMeta ifTrue:[ |
518 |
"/ "/ this should not happen |
|
519 |
"/ ('SMALLTALK: store a Metaclass: ' , aValue name , ' as ' , aKey) infoPrintCR. |
|
520 |
"/ ]. |
|
521 |
||
2379 | 522 |
aValue name == aKey ifTrue:[ |
523 |
CachedClasses add:aValue |
|
2814
712c2f62b74d
flush classCache if a strange class is added
Claus Gittinger <cg@exept.de>
parents:
2802
diff
changeset
|
524 |
] ifFalse:[ |
712c2f62b74d
flush classCache if a strange class is added
Claus Gittinger <cg@exept.de>
parents:
2802
diff
changeset
|
525 |
CachedClasses := nil |
2379 | 526 |
] |
527 |
]. |
|
453 | 528 |
]. |
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
529 |
^ aValue. |
1955 | 530 |
"/ |
531 |
"/%{ /* NOCONTEXT */ |
|
532 |
"/ (void) __GLOBAL_SET(aKey, aValue, (OBJ *)0); |
|
533 |
"/%}. |
|
534 |
"/ CachedClasses := nil. |
|
535 |
"/ ^ aValue |
|
1222 | 536 |
|
537 |
"Modified: 19.4.1996 / 11:31:49 / cg" |
|
453 | 538 |
! |
539 |
||
617 | 540 |
includesKey:aKey |
541 |
"return true, if the key is known" |
|
453 | 542 |
|
543 |
%{ /* NOCONTEXT */ |
|
617 | 544 |
RETURN ( __GLOBAL_KEYKNOWN(aKey) ); |
453 | 545 |
%} |
546 |
! |
|
547 |
||
548 |
keyAtValue:anObject |
|
549 |
"return the symbol under which anObject is stored - or nil" |
|
550 |
||
551 |
self keysDo:[:aKey | |
|
2379 | 552 |
(self at:aKey) == anObject ifTrue:[^ aKey] |
453 | 553 |
]. |
554 |
^ nil |
|
555 |
||
556 |
"Smalltalk keyAtValue:Object" |
|
557 |
! |
|
558 |
||
559 |
keys |
|
560 |
"return a collection with all keys in the Smalltalk dictionary" |
|
561 |
||
562 |
|keys| |
|
563 |
||
564 |
keys := IdentitySet new. |
|
565 |
self keysDo:[:k | keys add:k]. |
|
566 |
^ keys |
|
617 | 567 |
! |
568 |
||
569 |
removeKey:aKey |
|
878
c09b016c6674
do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents:
857
diff
changeset
|
570 |
"remove the association stored under the key-argument from the globals dictionary. |
c09b016c6674
do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents:
857
diff
changeset
|
571 |
WARNING: |
2379 | 572 |
this is somewhat dangerous: conceptionally, the association is removed, |
573 |
to which machine & byte compiled code refers if it accesses a global. |
|
574 |
If there are still global accesses in some literalArray or from machine-compiled code, |
|
575 |
it continues to reference the globals value via that obsolete association and gets a nil |
|
576 |
value. (which is correct) |
|
577 |
However, if that global is later reintroduced, a new association will be created and |
|
578 |
the new global now referenced via the new association. |
|
579 |
The old accesses will still see nil, although the globals value is actually non-nil |
|
580 |
(this is questionable). |
|
581 |
To avoid this problem, the #removeClass: method never removed the key." |
|
617 | 582 |
|
583 |
CachedClasses := nil. |
|
584 |
||
585 |
%{ /* NOCONTEXT */ |
|
586 |
RETURN ( __GLOBAL_REMOVE(aKey) ); |
|
587 |
%} |
|
2705
ed04a67da248
added #values for protocol completeness
Claus Gittinger <cg@exept.de>
parents:
2681
diff
changeset
|
588 |
! |
ed04a67da248
added #values for protocol completeness
Claus Gittinger <cg@exept.de>
parents:
2681
diff
changeset
|
589 |
|
ed04a67da248
added #values for protocol completeness
Claus Gittinger <cg@exept.de>
parents:
2681
diff
changeset
|
590 |
values |
ed04a67da248
added #values for protocol completeness
Claus Gittinger <cg@exept.de>
parents:
2681
diff
changeset
|
591 |
"return a collection with all values in the Smalltalk dictionary" |
ed04a67da248
added #values for protocol completeness
Claus Gittinger <cg@exept.de>
parents:
2681
diff
changeset
|
592 |
|
ed04a67da248
added #values for protocol completeness
Claus Gittinger <cg@exept.de>
parents:
2681
diff
changeset
|
593 |
|values| |
ed04a67da248
added #values for protocol completeness
Claus Gittinger <cg@exept.de>
parents:
2681
diff
changeset
|
594 |
|
ed04a67da248
added #values for protocol completeness
Claus Gittinger <cg@exept.de>
parents:
2681
diff
changeset
|
595 |
values := OrderedCollection new. |
ed04a67da248
added #values for protocol completeness
Claus Gittinger <cg@exept.de>
parents:
2681
diff
changeset
|
596 |
self do:[:v | values add:v]. |
ed04a67da248
added #values for protocol completeness
Claus Gittinger <cg@exept.de>
parents:
2681
diff
changeset
|
597 |
^ values |
ed04a67da248
added #values for protocol completeness
Claus Gittinger <cg@exept.de>
parents:
2681
diff
changeset
|
598 |
|
ed04a67da248
added #values for protocol completeness
Claus Gittinger <cg@exept.de>
parents:
2681
diff
changeset
|
599 |
"Created: 20.6.1997 / 16:58:28 / cg" |
453 | 600 |
! ! |
601 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
602 |
!Smalltalk class methodsFor:'binary storage'! |
453 | 603 |
|
2476 | 604 |
addGlobalsForBinaryStorageTo:globalDictionary |
453 | 605 |
|pools| |
606 |
||
607 |
pools := Set new. |
|
2465
1dfcacbbd376
ignore nil values when adding globals (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2418
diff
changeset
|
608 |
|
879 | 609 |
self keysAndValuesDo:[:key :value | |
2379 | 610 |
(key includes:$:) ifFalse:[ "/ skip classVars |
2465
1dfcacbbd376
ignore nil values when adding globals (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2418
diff
changeset
|
611 |
(value ~~ self |
1dfcacbbd376
ignore nil values when adding globals (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2418
diff
changeset
|
612 |
and:[value notNil]) ifTrue:[ |
2379 | 613 |
value isClass ifTrue:[ |
2476 | 614 |
value addGlobalsForBinaryStorageTo:globalDictionary. |
2379 | 615 |
pools addAll:value sharedPools |
616 |
] ifFalse:[ |
|
617 |
globalDictionary at:(key->value) put:self |
|
618 |
]. |
|
619 |
value notNil ifTrue:[ |
|
620 |
globalDictionary at:value put:self |
|
621 |
] |
|
622 |
] |
|
623 |
] |
|
453 | 624 |
]. |
625 |
||
626 |
pools do:[:poolDictionary| |
|
2476 | 627 |
poolDictionary addGlobalsForBinaryStorageTo:globalDictionary |
453 | 628 |
] |
2465
1dfcacbbd376
ignore nil values when adding globals (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2418
diff
changeset
|
629 |
|
1dfcacbbd376
ignore nil values when adding globals (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2418
diff
changeset
|
630 |
"Modified: 19.3.1997 / 18:15:25 / cg" |
2476 | 631 |
"Created: 21.3.1997 / 15:40:31 / cg" |
453 | 632 |
! |
633 |
||
879 | 634 |
storeBinaryDefinitionOf:anObject on:stream manager:manager |
453 | 635 |
|string| |
636 |
||
637 |
anObject class == Association ifTrue:[ |
|
2379 | 638 |
string := 'Smalltalk associationAt: ', anObject key storeString |
453 | 639 |
] ifFalse: [ |
2379 | 640 |
string := 'Smalltalk at: ', (self keyAtValue: anObject) storeString |
453 | 641 |
]. |
642 |
stream nextNumber:2 put:string size. |
|
2465
1dfcacbbd376
ignore nil values when adding globals (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2418
diff
changeset
|
643 |
stream nextPutBytes:(string size) from:string startingAt:1. |
1dfcacbbd376
ignore nil values when adding globals (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2418
diff
changeset
|
644 |
"/ string do:[:char | stream nextPut:char asciiValue] |
1dfcacbbd376
ignore nil values when adding globals (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2418
diff
changeset
|
645 |
|
1dfcacbbd376
ignore nil values when adding globals (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2418
diff
changeset
|
646 |
"Modified: 19.3.1997 / 18:49:14 / cg" |
453 | 647 |
! ! |
648 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
649 |
!Smalltalk class methodsFor:'browsing'! |
453 | 650 |
|
617 | 651 |
browseAllCallsOn:aSelectorSymbol |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
652 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
653 |
|
617 | 654 |
"startup a browser for all methods sending a particular message" |
655 |
||
656 |
SystemBrowser browseAllCallsOn:aSelectorSymbol |
|
657 |
||
658 |
" |
|
659 |
Smalltalk browseAllCallsOn:#at:put: |
|
660 |
" |
|
661 |
! |
|
662 |
||
663 |
browseAllSelect:aBlock |
|
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
664 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
665 |
|
617 | 666 |
"startup a browser for all methods for which aBlock returns true" |
667 |
||
668 |
SystemBrowser browseAllSelect:aBlock |
|
669 |
||
670 |
" |
|
671 |
Smalltalk browseAllSelect:[:m | m literals isNil] |
|
672 |
" |
|
673 |
! |
|
674 |
||
453 | 675 |
browseChanges |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
676 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
677 |
|
453 | 678 |
"startup a changes browser" |
679 |
||
680 |
ChangesBrowser notNil ifTrue:[ |
|
2379 | 681 |
ChangesBrowser open |
453 | 682 |
] ifFalse:[ |
2379 | 683 |
self warn:'no ChangesBrowser built in' |
453 | 684 |
] |
685 |
||
686 |
" |
|
687 |
Smalltalk browseChanges |
|
688 |
" |
|
689 |
! |
|
690 |
||
691 |
browseImplementorsOf:aSelectorSymbol |
|
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
692 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
693 |
|
453 | 694 |
"startup a browser for all methods implementing a particular message" |
695 |
||
696 |
SystemBrowser browseImplementorsOf:aSelectorSymbol |
|
697 |
||
698 |
" |
|
699 |
Smalltalk browseImplementorsOf:#at:put: |
|
700 |
" |
|
2844
a57a4b8ca9e9
preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
701 |
! |
a57a4b8ca9e9
preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
702 |
|
a57a4b8ca9e9
preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
703 |
syntaxHilighting |
a57a4b8ca9e9
preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
704 |
^ SyntaxHilighting |
a57a4b8ca9e9
preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
705 |
|
a57a4b8ca9e9
preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
706 |
"Created: 8.8.1997 / 10:55:22 / cg" |
453 | 707 |
! ! |
708 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
709 |
!Smalltalk class methodsFor:'class management'! |
453 | 710 |
|
711 |
flushCachedClasses |
|
712 |
CachedClasses := nil |
|
713 |
! |
|
714 |
||
715 |
removeClass:aClass |
|
716 |
"remove the argument, aClass from the smalltalk dictionary; |
|
717 |
we have to flush the caches since these methods are now void. |
|
718 |
Also, class variables of aClass are removed." |
|
719 |
||
2485
9f4a11a4521f
new #privateClasses semantic
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
720 |
|sym cSym names oldName| |
453 | 721 |
|
722 |
oldName := aClass name. |
|
723 |
sym := oldName asSymbol. |
|
724 |
((self at:sym) == aClass) ifFalse:[ |
|
2127 | 725 |
"check other name ..." |
726 |
(self includes:aClass) ifFalse:[ |
|
727 |
'Smalltalk [warning]: no such class: ' errorPrint. oldName errorPrintCR. |
|
728 |
^ self |
|
729 |
]. |
|
730 |
" |
|
731 |
the class has changed its name - without telling me ... |
|
732 |
what should be done in this case ? |
|
733 |
" |
|
734 |
'Smalltalk [warning]: class ' errorPrint. oldName errorPrint. |
|
735 |
' has changed its name' errorPrintCR. |
|
736 |
^ self |
|
453 | 737 |
]. |
738 |
||
739 |
self at:sym put:nil. "nil it out for compiled accesses" |
|
878
c09b016c6674
do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents:
857
diff
changeset
|
740 |
|
c09b016c6674
do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents:
857
diff
changeset
|
741 |
"/ |
c09b016c6674
do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents:
857
diff
changeset
|
742 |
"/ see comment in removeKey: on why we dont remove it here |
c09b016c6674
do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents:
857
diff
changeset
|
743 |
"/ |
c09b016c6674
do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents:
857
diff
changeset
|
744 |
"/ self removeKey:sym. "/ remove key - this actually fails, if there are |
2127 | 745 |
"/ still compiled code references." |
453 | 746 |
|
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
747 |
"remove private classes" |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
748 |
|
2485
9f4a11a4521f
new #privateClasses semantic
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
749 |
aClass privateClassesSorted do:[:somePrivateClass | |
9f4a11a4521f
new #privateClasses semantic
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
750 |
aClass privateClassesAt:(somePrivateClass nameWithoutPrefix) asSymbol put:nil. |
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
751 |
]. |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
752 |
|
453 | 753 |
"remove class variables" |
754 |
||
755 |
names := aClass classVariableString asCollectionOfWords. |
|
756 |
names do:[:name | |
|
2127 | 757 |
cSym := (sym , ':' , name) asSymbol. |
758 |
self at:cSym asSymbol put:nil. |
|
759 |
||
760 |
"/ |
|
761 |
"/ see comment in removeKey: on why we dont remove it here |
|
762 |
"/ |
|
763 |
"/ self removeKey:cSym |
|
453 | 764 |
]. |
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
765 |
|
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
766 |
|
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
767 |
"/ actually could get along with less flushing |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
768 |
"/ (entries for aClass and subclasses only) |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
769 |
"/ but we have to delay this, until we have the set of subclasses |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
770 |
"/ at hand - for now, searching for all subclasses is way more |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
771 |
"/ expensive then cache flushing. |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
772 |
"/ |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
773 |
"/ aClass allSubclassesDo:[:aSubclass | |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
774 |
"/ ObjectMemory flushInlineCachesForClass:aSubclass. |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
775 |
"/ ObjectMemory flushMethodCacheFor:aSubclass |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
776 |
"/ ]. |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
777 |
"/ ObjectMemory flushInlineCachesForClass:aClass. |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
778 |
"/ ObjectMemory flushMethodCacheFor:aClass |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
779 |
|
453 | 780 |
ObjectMemory flushInlineCaches. |
781 |
ObjectMemory flushMethodCache. |
|
782 |
||
783 |
aClass addChangeRecordForClassRemove:oldName. |
|
784 |
self changed:#classRemove with:aClass. |
|
785 |
||
1655 | 786 |
aClass category:#'* removed *'. |
787 |
||
2485
9f4a11a4521f
new #privateClasses semantic
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
788 |
"Modified: 22.3.1997 / 16:14:05 / cg" |
617 | 789 |
! |
790 |
||
791 |
renameClass:aClass to:newName |
|
1525
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
792 |
"rename aClass to newName. Most of the work is in |
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
793 |
renaming the classVariables (create & copy over values) |
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
794 |
and patching the classes methods to access the new variables." |
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
795 |
|
2270
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
796 |
|oldName oldSym newSym names oldCVSym newCVSym value oldNameToNewName |
2319
640bb389f90a
recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents:
2317
diff
changeset
|
797 |
oldNameSpace newNameSpace oldBaseName privateClasses| |
617 | 798 |
|
799 |
oldName := aClass name. |
|
2405
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
800 |
aClass isPrivate ifTrue:[ |
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
801 |
oldNameSpace := aClass topOwningClass nameSpace. |
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
802 |
] ifFalse:[ |
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
803 |
oldNameSpace := aClass nameSpace. |
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
804 |
]. |
2319
640bb389f90a
recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents:
2317
diff
changeset
|
805 |
oldBaseName := aClass nameWithoutNameSpacePrefix. |
617 | 806 |
oldSym := oldName asSymbol. |
2485
9f4a11a4521f
new #privateClasses semantic
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
807 |
privateClasses := aClass privateClassesSorted. |
2270
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
808 |
|
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
809 |
((self at:oldSym) ~~ aClass) ifTrue:[ |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
810 |
'Smalltalk [warning]: rename failed - name is different from key' errorPrintCR. |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
811 |
^ self |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
812 |
]. |
617 | 813 |
|
1525
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
814 |
"/ rename the class |
617 | 815 |
|
1847
6e567214b167
care for className being a symbol, when renaming classes
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
816 |
newSym := newName asSymbol. |
6e567214b167
care for className being a symbol, when renaming classes
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
817 |
aClass setName:newSym. |
617 | 818 |
|
1525
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
819 |
"/ store it in Smalltalk |
617 | 820 |
|
821 |
self at:oldSym put:nil. |
|
1525
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
822 |
|
878
c09b016c6674
do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents:
857
diff
changeset
|
823 |
"/ |
1525
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
824 |
"/ see comment in #removeKey: on why we dont remove it it here |
878
c09b016c6674
do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents:
857
diff
changeset
|
825 |
"/ |
c09b016c6674
do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents:
857
diff
changeset
|
826 |
"/ self removeKey:oldSym. |
617 | 827 |
self at:newSym put:aClass. |
828 |
||
1525
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
829 |
"/ create new class variables and copy over values |
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
830 |
|
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
831 |
oldNameToNewName := IdentityDictionary new. |
617 | 832 |
|
833 |
names := aClass classVariableString asCollectionOfWords. |
|
834 |
names do:[:name | |
|
2270
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
835 |
oldCVSym := (oldSym , ':' , name) asSymbol. |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
836 |
value := self at:oldCVSym. |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
837 |
self at:oldCVSym put:nil. |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
838 |
|
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
839 |
"/ |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
840 |
"/ see comment in #removeKey: on why we dont remove it it here |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
841 |
"/ |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
842 |
"/ self removeKey:cSym. |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
843 |
|
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
844 |
newCVSym := (newSym , ':' , name) asSymbol. |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
845 |
self at:newCVSym put:value. |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
846 |
|
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
847 |
oldNameToNewName at:oldCVSym put:newCVSym. |
1525
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
848 |
]. |
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
849 |
|
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
850 |
"/ patch methods literal arrays from oldCVname to newCVname |
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
851 |
|
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
852 |
oldNameToNewName keysAndValuesDo:[:oldNameSym :newNameSym | |
2270
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
853 |
aClass withAllSubclasses do:[:aSubClass | |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
854 |
aSubClass class methodDictionary do:[:aMethod | |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
855 |
aMethod changeLiteral:oldNameSym to:newNameSym |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
856 |
]. |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
857 |
aSubClass methodDictionary do:[:aMethod | |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
858 |
aMethod changeLiteral:oldNameSym to:newNameSym |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
859 |
] |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
860 |
]. |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
861 |
|
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
862 |
"/ and also in privateClasses ? ... |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
863 |
|
2485
9f4a11a4521f
new #privateClasses semantic
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
864 |
"/ privateClasses size > 0 ifTrue:[ |
2270
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
865 |
"/ privateClasses do:[:aPrivateClass | |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
866 |
"/ aPrivateClass withAllSubclasses do:[:aSubClass | |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
867 |
"/ aSubClass class methodDictionary do:[:aMethod | |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
868 |
"/ aMethod changeLiteral:oldNameSym to:newNameSym |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
869 |
"/ ]. |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
870 |
"/ aSubClass methodDictionary do:[:aMethod | |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
871 |
"/ aMethod changeLiteral:oldNameSym to:newNameSym |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
872 |
"/ ] |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
873 |
"/ ]. |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
874 |
"/ ] |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
875 |
"/ ] |
617 | 876 |
]. |
877 |
||
2270
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
878 |
aClass addChangeRecordForClassRename:oldSym to:newSym. |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
879 |
|
2405
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
880 |
aClass isPrivate ifTrue:[ |
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
881 |
newNameSpace := aClass topOwningClass nameSpace. |
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
882 |
] ifFalse:[ |
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
883 |
newNameSpace := aClass nameSpace. |
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
884 |
]. |
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
885 |
|
2485
9f4a11a4521f
new #privateClasses semantic
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
886 |
privateClasses size > 0 ifTrue:[ |
2405
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
887 |
"/ must rename privateClasses as well |
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
888 |
privateClasses do:[:aPrivateClass | |
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
889 |
self renameClass:aPrivateClass |
2514 | 890 |
to:(newSym , '::' , aPrivateClass nameWithoutPrefix). |
891 |
||
892 |
Transcript showCR:'recompiling methods in ''' , newNameSpace name , ''' accessing ''' , oldName , '::' , aPrivateClass nameWithoutPrefix , ''' ...'. |
|
893 |
Class class |
|
894 |
recompileGlobalAccessorsTo:(oldName , '::' , aPrivateClass nameWithoutPrefix) asSymbol |
|
895 |
in:newNameSpace |
|
896 |
except:nil. |
|
2405
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
897 |
] |
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
898 |
]. |
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
899 |
|
2319
640bb389f90a
recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents:
2317
diff
changeset
|
900 |
oldNameSpace ~~ newNameSpace ifTrue:[ |
640bb389f90a
recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents:
2317
diff
changeset
|
901 |
"/ all those referencing the class from the old nameSpace |
640bb389f90a
recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents:
2317
diff
changeset
|
902 |
"/ must be recompiled ... |
640bb389f90a
recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents:
2317
diff
changeset
|
903 |
"/ (to now access the global from smalltalk) |
640bb389f90a
recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents:
2317
diff
changeset
|
904 |
|
640bb389f90a
recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents:
2317
diff
changeset
|
905 |
oldNameSpace ~~ Smalltalk ifTrue:[ |
640bb389f90a
recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents:
2317
diff
changeset
|
906 |
Transcript showCR:'recompiling methods in ''' , oldNameSpace name , ''' accessing ''' , oldName , ''' ...'. |
640bb389f90a
recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents:
2317
diff
changeset
|
907 |
|
640bb389f90a
recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents:
2317
diff
changeset
|
908 |
Class class |
640bb389f90a
recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents:
2317
diff
changeset
|
909 |
recompileGlobalAccessorsTo:oldName asSymbol |
640bb389f90a
recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents:
2317
diff
changeset
|
910 |
in:oldNameSpace |
640bb389f90a
recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents:
2317
diff
changeset
|
911 |
except:nil. |
640bb389f90a
recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents:
2317
diff
changeset
|
912 |
]. |
640bb389f90a
recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents:
2317
diff
changeset
|
913 |
|
640bb389f90a
recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents:
2317
diff
changeset
|
914 |
"/ all referencing the class in the new namespace |
640bb389f90a
recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents:
2317
diff
changeset
|
915 |
"/ as well; to now access the new class. |
640bb389f90a
recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents:
2317
diff
changeset
|
916 |
|
2345 | 917 |
(newNameSpace notNil and:[newNameSpace ~~ Smalltalk]) ifTrue:[ |
2319
640bb389f90a
recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents:
2317
diff
changeset
|
918 |
Transcript showCR:'recompiling methods in ''' , newNameSpace name , ''' accessing ''' , oldBaseName , ''' ...'. |
640bb389f90a
recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents:
2317
diff
changeset
|
919 |
|
640bb389f90a
recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents:
2317
diff
changeset
|
920 |
Class class |
640bb389f90a
recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents:
2317
diff
changeset
|
921 |
recompileGlobalAccessorsTo:oldBaseName asSymbol |
640bb389f90a
recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents:
2317
diff
changeset
|
922 |
in:newNameSpace |
640bb389f90a
recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents:
2317
diff
changeset
|
923 |
except:nil. |
2514 | 924 |
]. |
925 |
||
926 |
||
2319
640bb389f90a
recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents:
2317
diff
changeset
|
927 |
]. |
617 | 928 |
|
929 |
"Created: 29.10.1995 / 19:58:32 / cg" |
|
1480
df0bea6285f8
Change the name of a classes Metaclass from e.g. "SmallIntegerclass" to
Stefan Vogel <sv@exept.de>
parents:
1461
diff
changeset
|
930 |
"Modified: 18.6.1996 / 14:20:50 / stefan" |
2677
909ae9953e34
metaclasses no longer have a name
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
931 |
"Modified: 5.6.1997 / 09:49:59 / cg" |
453 | 932 |
! ! |
933 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
934 |
!Smalltalk class methodsFor:'copying'! |
453 | 935 |
|
617 | 936 |
deepCopy |
1410 | 937 |
"redefined to return self - there is only one Smalltalk dictionary" |
453 | 938 |
|
939 |
^ self |
|
1410 | 940 |
|
941 |
"Modified: 18.5.1996 / 12:13:33 / cg" |
|
453 | 942 |
! |
943 |
||
944 |
deepCopyUsing:aDictionary |
|
1410 | 945 |
"redefined to return self - there is only one Smalltalk dictionary" |
453 | 946 |
|
947 |
^ self |
|
1410 | 948 |
|
949 |
"Modified: 18.5.1996 / 12:13:36 / cg" |
|
453 | 950 |
! |
951 |
||
617 | 952 |
shallowCopy |
1410 | 953 |
"redefined to return self - there is only one Smalltalk dictionary" |
617 | 954 |
|
955 |
^ self |
|
1410 | 956 |
|
957 |
"Modified: 18.5.1996 / 12:13:39 / cg" |
|
617 | 958 |
! |
959 |
||
960 |
simpleDeepCopy |
|
1410 | 961 |
"redefined to return self - there is only one Smalltalk dictionary" |
453 | 962 |
|
963 |
^ self |
|
1410 | 964 |
|
965 |
"Modified: 18.5.1996 / 12:13:42 / cg" |
|
453 | 966 |
! ! |
967 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
968 |
!Smalltalk class methodsFor:'debugging ST/X'! |
453 | 969 |
|
970 |
debugBreakPoint |
|
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
971 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
972 |
|
453 | 973 |
"call the dummy debug function, on which a breakpoint |
974 |
can be put in adb, sdb, dbx or gdb. |
|
975 |
WARNING: this method is for debugging only |
|
2379 | 976 |
it will be removed without notice." |
453 | 977 |
%{ |
2212 | 978 |
__PATCHUPCONTEXTS(__context); |
808
1919838112d1
renamed debugBreakPoint -> __debugBreakPoint__
Claus Gittinger <cg@exept.de>
parents:
796
diff
changeset
|
979 |
__debugBreakPoint__(); |
453 | 980 |
%} |
981 |
! |
|
982 |
||
617 | 983 |
exitWithCoreDump |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
984 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
985 |
|
617 | 986 |
"abort program and dump core" |
987 |
||
988 |
%{ /* NOCONTEXT */ |
|
989 |
abort(); |
|
990 |
/* NEVER RETURNS */ |
|
991 |
%} |
|
992 |
! |
|
993 |
||
994 |
fatalAbort |
|
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
995 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
996 |
|
617 | 997 |
"report a fatal-error, print a stack backtrace and exit with core dump. |
998 |
(You may turn off the stack print with debugPrinting:false)" |
|
999 |
%{ |
|
1000 |
__fatal0(__context, "fatalAbort"); |
|
1001 |
/* NEVER RETURNS */ |
|
1002 |
%} |
|
1003 |
! |
|
1004 |
||
1005 |
fatalAbort:aMessage |
|
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1006 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1007 |
|
617 | 1008 |
"report a fatal-error; print a stack backtrace and exit with core dump |
1009 |
(You may turn off the stack print with debugPrinting:false)" |
|
1010 |
||
1011 |
%{ |
|
1012 |
char *msg; |
|
1013 |
||
1014 |
if (__isString(aMessage)) |
|
2379 | 1015 |
msg = (char *) __stringVal(aMessage); |
617 | 1016 |
else |
2379 | 1017 |
msg = "fatalAbort"; |
617 | 1018 |
|
1019 |
__fatal0(__context, msg); |
|
1020 |
/* NEVER RETURNS */ |
|
1021 |
%} |
|
1022 |
! |
|
1023 |
||
453 | 1024 |
printPolyCaches |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1025 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1026 |
|
453 | 1027 |
"dump poly caches. |
1028 |
WARNING: this method is for debugging only |
|
2379 | 1029 |
it will be removed without notice" |
453 | 1030 |
%{ |
1031 |
__dumpILCCaches(); |
|
1032 |
%} |
|
1033 |
! |
|
1034 |
||
1035 |
printStackBacktrace |
|
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1036 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1037 |
|
453 | 1038 |
"print a stack backtrace - then continue. |
1039 |
(You may turn off the stack print with debugPrinting:false) |
|
1040 |
WARNING: this method is for debugging only |
|
2379 | 1041 |
it will be removed without notice" |
453 | 1042 |
|
1043 |
%{ |
|
1044 |
__printStack(__context); |
|
1045 |
%} |
|
1046 |
"Smalltalk printStackBacktrace" |
|
1047 |
! |
|
1048 |
||
1049 |
printSymbols |
|
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1050 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1051 |
|
453 | 1052 |
"dump the internal symbol table. |
1053 |
WARNING: this method is for debugging only |
|
2379 | 1054 |
it will be removed without notice" |
453 | 1055 |
%{ |
790
73131541a373
debug functions is only available if compiled with -DDEBUG
Claus Gittinger <cg@exept.de>
parents:
785
diff
changeset
|
1056 |
#ifdef DEBUG |
453 | 1057 |
__dumpSymbols(); |
790
73131541a373
debug functions is only available if compiled with -DDEBUG
Claus Gittinger <cg@exept.de>
parents:
785
diff
changeset
|
1058 |
#endif |
453 | 1059 |
%} |
1060 |
! |
|
1061 |
||
785
c666457288e1
added sendTraceOn / sendTraceOff
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1062 |
sendTraceOff |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1063 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1064 |
|
785
c666457288e1
added sendTraceOn / sendTraceOff
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1065 |
"turns tracing of message sends off. |
c666457288e1
added sendTraceOn / sendTraceOff
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1066 |
WARNING: this method is for debugging only |
2379 | 1067 |
it may be removed without notice" |
785
c666457288e1
added sendTraceOn / sendTraceOff
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1068 |
|
c666457288e1
added sendTraceOn / sendTraceOff
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1069 |
%{ /* NOCONTEXT */ |
796
28cde02334c8
use functional interface to set/clear messageTrace
Claus Gittinger <cg@exept.de>
parents:
790
diff
changeset
|
1070 |
__setMessageTrace__(0); |
785
c666457288e1
added sendTraceOn / sendTraceOff
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1071 |
%} |
c666457288e1
added sendTraceOn / sendTraceOff
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1072 |
! |
c666457288e1
added sendTraceOn / sendTraceOff
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1073 |
|
c666457288e1
added sendTraceOn / sendTraceOff
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1074 |
sendTraceOn |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1075 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1076 |
|
785
c666457288e1
added sendTraceOn / sendTraceOff
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1077 |
"turns tracing of message sends on. |
c666457288e1
added sendTraceOn / sendTraceOff
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1078 |
WARNING: this method is for debugging only |
2379 | 1079 |
it may be removed without notice" |
785
c666457288e1
added sendTraceOn / sendTraceOff
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1080 |
|
c666457288e1
added sendTraceOn / sendTraceOff
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1081 |
%{ /* NOCONTEXT */ |
796
28cde02334c8
use functional interface to set/clear messageTrace
Claus Gittinger <cg@exept.de>
parents:
790
diff
changeset
|
1082 |
__setMessageTrace__(1); |
785
c666457288e1
added sendTraceOn / sendTraceOff
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1083 |
%} |
c666457288e1
added sendTraceOn / sendTraceOff
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1084 |
! |
c666457288e1
added sendTraceOn / sendTraceOff
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1085 |
|
453 | 1086 |
statistic |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1087 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1088 |
|
453 | 1089 |
"print some statistic data. |
1090 |
WARNING: this method is for debugging only |
|
2379 | 1091 |
it may be removed without notice" |
453 | 1092 |
|
1093 |
%{ /* NOCONTEXT */ |
|
1094 |
__STATISTIC__(); |
|
1095 |
%} |
|
1096 |
! ! |
|
1097 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1098 |
!Smalltalk class methodsFor:'enumerating'! |
453 | 1099 |
|
1100 |
allBehaviorsDo:aBlock |
|
1101 |
"evaluate the argument, aBlock for all classes in the system" |
|
1102 |
||
1103 |
CachedClasses isNil ifTrue:[ |
|
2379 | 1104 |
self allClasses |
453 | 1105 |
]. |
1106 |
CachedClasses do:aBlock |
|
1107 |
||
1108 |
" |
|
2588
090cf1da8036
handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents:
2572
diff
changeset
|
1109 |
Smalltalk allBehaviorsDo:[:aClass | aClass name printCR] |
453 | 1110 |
" |
1111 |
! |
|
1112 |
||
1113 |
allClassesDo:aBlock |
|
1114 |
"evaluate the argument, aBlock for all classes in the system. |
|
1115 |
Backward compatibility - use #allBehaviorsDo: for ST-80 compatibility." |
|
1116 |
||
1117 |
^ self allBehaviorsDo:aBlock |
|
1118 |
||
1119 |
" |
|
2588
090cf1da8036
handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents:
2572
diff
changeset
|
1120 |
Smalltalk allClassesDo:[:aClass | aClass name printCR] |
453 | 1121 |
" |
1122 |
! |
|
1123 |
||
1299 | 1124 |
allClassesInCategory:aCategory |
1125 |
"return a collection of for all classes in aCategory; |
|
1126 |
The order of the classes is not defined." |
|
1127 |
||
1128 |
|coll| |
|
1129 |
||
1130 |
coll := OrderedCollection new. |
|
1131 |
self allClassesInCategory:aCategory do:[:aClass | |
|
2379 | 1132 |
coll add:aClass |
1299 | 1133 |
]. |
1134 |
^ coll |
|
1135 |
||
1136 |
" |
|
1137 |
Smalltalk allClassesInCategory:'Views-Basic' |
|
1138 |
" |
|
1139 |
||
1140 |
"Modified: 25.4.1996 / 18:06:13 / cg" |
|
1141 |
! |
|
1142 |
||
453 | 1143 |
allClassesInCategory:aCategory do:aBlock |
1144 |
"evaluate the argument, aBlock for all classes in the aCategory; |
|
1145 |
The order of the classes is not defined." |
|
1146 |
||
1147 |
aCategory notNil ifTrue:[ |
|
2379 | 1148 |
self allBehaviorsDo:[:aClass | |
1149 |
aClass isMeta ifFalse:[ |
|
1150 |
(aClass category = aCategory) ifTrue:[ |
|
1151 |
aBlock value:aClass |
|
1152 |
] |
|
1153 |
] |
|
1154 |
] |
|
453 | 1155 |
] |
1156 |
||
1157 |
" |
|
2588
090cf1da8036
handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents:
2572
diff
changeset
|
1158 |
Smalltalk allClassesInCategory:'Views-Basic' do:[:aClass | aClass name printCR] |
453 | 1159 |
" |
1160 |
! |
|
1161 |
||
1162 |
allClassesInCategory:aCategory inOrderDo:aBlock |
|
1163 |
"evaluate the argument, aBlock for all classes in aCategory; |
|
1164 |
superclasses come first - then subclasses" |
|
1165 |
||
1166 |
|classes| |
|
1167 |
||
1168 |
aCategory notNil ifTrue:[ |
|
2379 | 1169 |
classes := OrderedCollection new. |
1170 |
self allBehaviorsDo:[:aClass | |
|
1171 |
aClass isMeta ifFalse:[ |
|
1172 |
(aClass category = aCategory) ifTrue:[ |
|
1173 |
classes add:aClass |
|
1174 |
] |
|
1175 |
] |
|
1176 |
]. |
|
1177 |
classes topologicalSort:[:a :b | b isSubclassOf:a]. |
|
1178 |
classes do:aBlock |
|
453 | 1179 |
] |
1180 |
||
1181 |
" |
|
2588
090cf1da8036
handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents:
2572
diff
changeset
|
1182 |
Smalltalk allClassesInCategory:'Views-Basic' inOrderDo:[:aClass | aClass name printCR] |
453 | 1183 |
" |
617 | 1184 |
! |
1185 |
||
1186 |
allKeysDo:aBlock |
|
1187 |
"evaluate the argument, aBlock for all keys in the Smalltalk dictionary" |
|
1188 |
||
1189 |
^ self keysDo:aBlock |
|
1190 |
! |
|
1191 |
||
1192 |
associationsDo:aBlock |
|
1193 |
"evaluate the argument, aBlock for all key/value pairs |
|
1194 |
in the Smalltalk dictionary" |
|
1195 |
||
1196 |
self keysDo:[:aKey | |
|
2379 | 1197 |
aBlock value:(aKey -> (self at:aKey)) |
617 | 1198 |
] |
1199 |
||
2588
090cf1da8036
handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents:
2572
diff
changeset
|
1200 |
"Smalltalk associationsDo:[:assoc | assoc printCR]" |
617 | 1201 |
! |
1202 |
||
1203 |
do:aBlock |
|
1204 |
"evaluate the argument, aBlock for all values in the Smalltalk dictionary" |
|
1205 |
||
1206 |
|work| |
|
1207 |
||
1208 |
%{ /* NOREGISTER - work may not be placed into a register here */ |
|
1688
8a42db1eea60
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
1682
diff
changeset
|
1209 |
__GLOBALS_DO(&aBlock, &work); |
617 | 1210 |
%} |
1211 |
! |
|
1212 |
||
1213 |
keysAndValuesDo:aBlock |
|
1214 |
"evaluate the two-arg block, aBlock for all keys and values" |
|
1215 |
||
1216 |
self keysDo:[:aKey | |
|
2379 | 1217 |
aBlock value:aKey value:(self at:aKey) |
617 | 1218 |
] |
1219 |
! |
|
1220 |
||
1221 |
keysDo:aBlock |
|
1222 |
"evaluate the argument, aBlock for all keys in the Smalltalk dictionary" |
|
1223 |
|work| |
|
1224 |
||
1225 |
%{ /* NOREGISTER - work may not be placed into a register here */ |
|
1688
8a42db1eea60
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
1682
diff
changeset
|
1226 |
__GLOBALKEYS_DO(&aBlock, &work); |
617 | 1227 |
%} |
453 | 1228 |
! ! |
1229 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1230 |
!Smalltalk class methodsFor:'inspecting'! |
453 | 1231 |
|
1232 |
inspectorClass |
|
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1233 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1234 |
|
453 | 1235 |
"redefined to launch a DictionaryInspector |
1236 |
(instead of the default Inspector)." |
|
1237 |
||
1238 |
^ DictionaryInspectorView |
|
1239 |
! ! |
|
1240 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1241 |
!Smalltalk class methodsFor:'message control'! |
453 | 1242 |
|
1243 |
silentLoading |
|
1244 |
"returns the Silentloading class variable." |
|
1245 |
||
1246 |
^ SilentLoading |
|
1247 |
! |
|
1248 |
||
1249 |
silentLoading:aBoolean |
|
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1250 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1251 |
|
453 | 1252 |
"allows access to the Silentloading class variable, which controls |
1253 |
messages from all kinds of system onto the transcript. |
|
1254 |
You can save a snapshot with this flag set to true, which makes |
|
1255 |
the image come up silent. Can also be set, to read in files unlogged." |
|
1256 |
||
1257 |
|prev| |
|
1258 |
||
1259 |
prev := SilentLoading. |
|
1260 |
SilentLoading := aBoolean. |
|
1261 |
^ prev |
|
1262 |
! ! |
|
1263 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1264 |
!Smalltalk class methodsFor:'misc stuff'! |
453 | 1265 |
|
617 | 1266 |
addExitBlock:aBlock |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1267 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1268 |
|
617 | 1269 |
"add a block to be executed when Smalltalk finishes. |
1270 |
This feature is currently not used anywhere - but could be useful for |
|
1271 |
cleanup in stand alone applications." |
|
1272 |
||
1273 |
ExitBlocks isNil ifTrue:[ |
|
2379 | 1274 |
ExitBlocks := OrderedCollection with:aBlock |
617 | 1275 |
] ifFalse:[ |
2379 | 1276 |
ExitBlocks add:aBlock |
617 | 1277 |
] |
1278 |
! |
|
1279 |
||
1650
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1280 |
addImageStartBlock:aBlock |
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1281 |
"{ Pragma: +optSpace }" |
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1282 |
|
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1283 |
"add a blocks to be executed in a separate process after |
2681 | 1284 |
everything has been initialized. |
1285 |
These blocks will be executed after an image restart." |
|
1650
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1286 |
|
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1287 |
ImageStartBlocks isNil ifTrue:[ |
2379 | 1288 |
ImageStartBlocks := OrderedCollection with:aBlock |
1650
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1289 |
] ifFalse:[ |
2379 | 1290 |
ImageStartBlocks add:aBlock |
1650
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1291 |
] |
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1292 |
|
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1293 |
"Created: 9.9.1996 / 16:48:20 / stefan" |
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1294 |
! |
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1295 |
|
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1296 |
addStartBlock:aBlock |
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1297 |
"{ Pragma: +optSpace }" |
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1298 |
|
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1299 |
"add a blocks to be executed in a separate process after |
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1300 |
everything has been initialized. These blocks will |
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1301 |
be deleted after execution and therefore not be |
2681 | 1302 |
executed after an image restart. |
1303 |
Initial processes are usually started here (see smalltalk.rc / private.rc)." |
|
1650
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1304 |
|
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1305 |
StartBlocks isNil ifTrue:[ |
2379 | 1306 |
StartBlocks := OrderedCollection with:aBlock |
1650
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1307 |
] ifFalse:[ |
2379 | 1308 |
StartBlocks add:aBlock |
1650
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1309 |
] |
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1310 |
|
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1311 |
"Created: 9.9.1996 / 16:46:53 / stefan" |
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1312 |
! |
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1313 |
|
453 | 1314 |
exit |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1315 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1316 |
|
453 | 1317 |
"finish Smalltalk system" |
1318 |
||
1319 |
ObjectMemory changed:#aboutToQuit. "/ for ST-80 compatibility |
|
1320 |
ExitBlocks notNil ifTrue:[ |
|
2379 | 1321 |
ExitBlocks do:[:aBlock | |
1322 |
aBlock value |
|
1323 |
] |
|
453 | 1324 |
]. |
1325 |
OperatingSystem exit |
|
1326 |
||
1327 |
" |
|
1328 |
Smalltalk exit |
|
1329 |
" |
|
1330 |
! |
|
1331 |
||
1332 |
sleep:aDelay |
|
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1333 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1334 |
|
453 | 1335 |
"wait for aDelay seconds. |
1336 |
OBSOLETE: this is historical leftover and will be removed" |
|
1337 |
||
1338 |
OperatingSystem sleep:aDelay |
|
1339 |
! ! |
|
1340 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1341 |
!Smalltalk class methodsFor:'queries'! |
453 | 1342 |
|
1343 |
allClasses |
|
1344 |
"return an unordered collection of all classes in the system. |
|
1345 |
Only globally anchored classes are returned |
|
1346 |
(i.e. anonymous ones have to be aquired by Behavior allSubInstances)" |
|
1347 |
||
1348 |
|classes| |
|
1349 |
||
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
1350 |
"/ you may wonder, what this while is for, here ... |
453 | 1351 |
"/ the reason is that if we modify the class hierarchy in |
1352 |
"/ anothe view (background fileIn), while building up the |
|
1353 |
"/ cachedClasses set, this may be flushed (invalidated) by the |
|
1354 |
"/ other process in the meanwhile. |
|
1355 |
"/ If that happens, we restart the set-building here |
|
1356 |
"/ |
|
1357 |
[(classes := CachedClasses) isNil] whileTrue:[ |
|
2379 | 1358 |
CachedClasses := classes := IdentitySet new:800. |
1359 |
self do:[:anObject | |
|
1360 |
anObject notNil ifTrue:[ |
|
1361 |
anObject isBehavior ifTrue:[ |
|
1362 |
classes add:anObject |
|
1363 |
] |
|
1364 |
] |
|
1365 |
] |
|
453 | 1366 |
]. |
1367 |
^ classes |
|
1368 |
||
1369 |
" |
|
1370 |
Smalltalk allClasses |
|
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
1371 |
|
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
1372 |
to get the list sorted by name: |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
1373 |
|
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
1374 |
Smalltalk allClasses asSortedCollection:[:a :b | a name < b name] |
453 | 1375 |
" |
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
1376 |
|
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
1377 |
"Modified: 13.12.1995 / 14:52:50 / cg" |
453 | 1378 |
! |
1379 |
||
617 | 1380 |
cellAt:aName |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1381 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1382 |
|
617 | 1383 |
"return the address of a global cell |
1384 |
- used internally for compiler only" |
|
1385 |
||
1386 |
%{ /* NOCONTEXT */ |
|
1387 |
RETURN ( __GLOBAL_GETCELL(aName) ); |
|
1388 |
%} |
|
1389 |
! |
|
1390 |
||
453 | 1391 |
classNamed:aString |
1392 |
"return the class with name aString, or nil if absent. |
|
1480
df0bea6285f8
Change the name of a classes Metaclass from e.g. "SmallIntegerclass" to
Stefan Vogel <sv@exept.de>
parents:
1461
diff
changeset
|
1393 |
To get to the metaClass, append ' class' to the string." |
453 | 1394 |
|
644
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1395 |
|cls sym meta| |
453 | 1396 |
|
1397 |
"be careful, to not invent new symbols ..." |
|
1398 |
sym := aString asSymbolIfInterned. |
|
1399 |
sym notNil ifTrue:[ |
|
2379 | 1400 |
cls := self at:sym ifAbsent:[]. |
1401 |
cls isBehavior ifTrue:[^ cls] |
|
453 | 1402 |
]. |
1480
df0bea6285f8
Change the name of a classes Metaclass from e.g. "SmallIntegerclass" to
Stefan Vogel <sv@exept.de>
parents:
1461
diff
changeset
|
1403 |
(aString endsWith:' class') ifTrue:[ |
df0bea6285f8
Change the name of a classes Metaclass from e.g. "SmallIntegerclass" to
Stefan Vogel <sv@exept.de>
parents:
1461
diff
changeset
|
1404 |
|
2379 | 1405 |
meta := self classNamed:(aString copyWithoutLast:6). |
1406 |
meta notNil ifTrue:[ |
|
1407 |
^ meta class |
|
1408 |
]. |
|
453 | 1409 |
]. |
1410 |
^ nil |
|
1411 |
||
1412 |
" |
|
1413 |
Smalltalk classNamed:'Object' |
|
1414 |
Smalltalk classNamed:'fooBar' |
|
1415 |
Smalltalk classNamed:'true' |
|
1480
df0bea6285f8
Change the name of a classes Metaclass from e.g. "SmallIntegerclass" to
Stefan Vogel <sv@exept.de>
parents:
1461
diff
changeset
|
1416 |
Smalltalk classNamed:'Object class' |
453 | 1417 |
Smalltalk classNamed:'Metaclass' |
644
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1418 |
Smalltalk classNamed:'Array' |
1480
df0bea6285f8
Change the name of a classes Metaclass from e.g. "SmallIntegerclass" to
Stefan Vogel <sv@exept.de>
parents:
1461
diff
changeset
|
1419 |
Smalltalk classNamed:'Array class' |
453 | 1420 |
" |
644
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1421 |
|
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1422 |
"Created: 24.11.1995 / 17:30:22 / cg" |
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1423 |
"Modified: 24.11.1995 / 17:31:29 / cg" |
1480
df0bea6285f8
Change the name of a classes Metaclass from e.g. "SmallIntegerclass" to
Stefan Vogel <sv@exept.de>
parents:
1461
diff
changeset
|
1424 |
"Modified: 19.6.1996 / 14:22:21 / stefan" |
453 | 1425 |
! |
1426 |
||
1427 |
classNames |
|
1428 |
"return a collection of all classNames in the system" |
|
1429 |
||
1430 |
^ self allClasses collect:[:aClass | aClass name] |
|
1431 |
||
644
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1432 |
" |
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1433 |
Smalltalk classNames |
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1434 |
" |
453 | 1435 |
! |
1436 |
||
1437 |
classnameCompletion:aPartialClassName |
|
1438 |
"given a partial classname, return an array consisting of |
|
1439 |
2 entries: 1st: collection consisting of matching names |
|
2379 | 1440 |
2nd: the best (longest) match" |
644
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1441 |
|
2523
04db1fd74e0d
try ignoring case in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1442 |
|searchName matches ignCaseMatches best isMatchString| |
644
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1443 |
|
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1444 |
searchName := aPartialClassName. |
2379 | 1445 |
searchName isEmpty ifTrue:[ |
1446 |
^ Array with:searchName with:#() |
|
1447 |
]. |
|
1448 |
||
644
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1449 |
(searchName at:1) isLowercase ifTrue:[ |
2379 | 1450 |
searchName := searchName copy asUppercaseFirst |
644
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1451 |
]. |
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1452 |
|
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1453 |
isMatchString := searchName includesMatchCharacters. |
1451 | 1454 |
matches := OrderedCollection new. |
2523
04db1fd74e0d
try ignoring case in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1455 |
ignCaseMatches := OrderedCollection new. |
453 | 1456 |
self allClassesDo:[:aClass | |
2379 | 1457 |
|className addIt| |
1458 |
||
1459 |
className := aClass name. |
|
1460 |
aClass isMeta ifFalse:[ |
|
1451 | 1461 |
|
2379 | 1462 |
isMatchString ifTrue:[ |
1463 |
addIt := searchName match:className |
|
1464 |
] ifFalse:[ |
|
1465 |
addIt := className startsWith:searchName |
|
1466 |
]. |
|
1467 |
addIt ifTrue:[ |
|
1468 |
matches add:aClass name |
|
2523
04db1fd74e0d
try ignoring case in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1469 |
] ifFalse:[ |
04db1fd74e0d
try ignoring case in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1470 |
"/ try ignoring case |
04db1fd74e0d
try ignoring case in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1471 |
isMatchString ifTrue:[ |
04db1fd74e0d
try ignoring case in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1472 |
addIt := searchName match:className ignoreCase:true |
04db1fd74e0d
try ignoring case in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1473 |
] ifFalse:[ |
04db1fd74e0d
try ignoring case in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1474 |
addIt := className asLowercase startsWith:searchName asLowercase |
04db1fd74e0d
try ignoring case in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1475 |
]. |
04db1fd74e0d
try ignoring case in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1476 |
addIt ifTrue:[ |
04db1fd74e0d
try ignoring case in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1477 |
ignCaseMatches add:aClass name |
04db1fd74e0d
try ignoring case in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1478 |
] |
2379 | 1479 |
] |
1480 |
] |
|
453 | 1481 |
]. |
1451 | 1482 |
|
453 | 1483 |
matches isEmpty ifTrue:[ |
2523
04db1fd74e0d
try ignoring case in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1484 |
matches := ignCaseMatches |
04db1fd74e0d
try ignoring case in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1485 |
]. |
04db1fd74e0d
try ignoring case in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1486 |
|
04db1fd74e0d
try ignoring case in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1487 |
matches isEmpty ifTrue:[ |
2379 | 1488 |
^ Array with:searchName with:(Array with:searchName) |
453 | 1489 |
]. |
1490 |
matches size == 1 ifTrue:[ |
|
2379 | 1491 |
^ Array with:matches first with:(matches asArray) |
453 | 1492 |
]. |
1451 | 1493 |
matches := matches asSortedCollection. |
644
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1494 |
isMatchString ifTrue:[ |
2379 | 1495 |
best := searchName. |
644
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1496 |
] ifFalse:[ |
2379 | 1497 |
best := matches longestCommonPrefix. |
644
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1498 |
]. |
453 | 1499 |
^ Array with:best with:matches asArray |
1500 |
||
1501 |
" |
|
1502 |
Smalltalk classnameCompletion:'Arr' |
|
1503 |
Smalltalk classnameCompletion:'Arra' |
|
644
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1504 |
Smalltalk classnameCompletion:'arra' |
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1505 |
Smalltalk classnameCompletion:'*rray' |
453 | 1506 |
" |
644
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1507 |
|
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
1508 |
"Created: 24.11.1995 / 17:24:45 / cg" |
2523
04db1fd74e0d
try ignoring case in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1509 |
"Modified: 3.4.1997 / 18:25:01 / cg" |
453 | 1510 |
! |
1511 |
||
2004
b660837fe0c7
renamed #currentNameSpace to #defaultNameSpace
Claus Gittinger <cg@exept.de>
parents:
1971
diff
changeset
|
1512 |
defaultNameSpace |
b660837fe0c7
renamed #currentNameSpace to #defaultNameSpace
Claus Gittinger <cg@exept.de>
parents:
1971
diff
changeset
|
1513 |
"return the default namespace, where new classes are installed, |
b660837fe0c7
renamed #currentNameSpace to #defaultNameSpace
Claus Gittinger <cg@exept.de>
parents:
1971
diff
changeset
|
1514 |
if NO special nameSpace handler is present" |
b660837fe0c7
renamed #currentNameSpace to #defaultNameSpace
Claus Gittinger <cg@exept.de>
parents:
1971
diff
changeset
|
1515 |
|
2029
55ddf4c547ab
ask the current project for the defaultNameSpace
Claus Gittinger <cg@exept.de>
parents:
2004
diff
changeset
|
1516 |
|p| |
55ddf4c547ab
ask the current project for the defaultNameSpace
Claus Gittinger <cg@exept.de>
parents:
2004
diff
changeset
|
1517 |
|
55ddf4c547ab
ask the current project for the defaultNameSpace
Claus Gittinger <cg@exept.de>
parents:
2004
diff
changeset
|
1518 |
(Project notNil and:[(p := Project current) notNil]) ifTrue:[ |
2379 | 1519 |
^ p defaultNameSpace |
2029
55ddf4c547ab
ask the current project for the defaultNameSpace
Claus Gittinger <cg@exept.de>
parents:
2004
diff
changeset
|
1520 |
]. |
55ddf4c547ab
ask the current project for the defaultNameSpace
Claus Gittinger <cg@exept.de>
parents:
2004
diff
changeset
|
1521 |
|
2004
b660837fe0c7
renamed #currentNameSpace to #defaultNameSpace
Claus Gittinger <cg@exept.de>
parents:
1971
diff
changeset
|
1522 |
^ self |
b660837fe0c7
renamed #currentNameSpace to #defaultNameSpace
Claus Gittinger <cg@exept.de>
parents:
1971
diff
changeset
|
1523 |
|
b660837fe0c7
renamed #currentNameSpace to #defaultNameSpace
Claus Gittinger <cg@exept.de>
parents:
1971
diff
changeset
|
1524 |
"Created: 19.12.1996 / 23:49:25 / cg" |
2029
55ddf4c547ab
ask the current project for the defaultNameSpace
Claus Gittinger <cg@exept.de>
parents:
2004
diff
changeset
|
1525 |
"Modified: 2.1.1997 / 20:01:31 / cg" |
2004
b660837fe0c7
renamed #currentNameSpace to #defaultNameSpace
Claus Gittinger <cg@exept.de>
parents:
1971
diff
changeset
|
1526 |
! |
b660837fe0c7
renamed #currentNameSpace to #defaultNameSpace
Claus Gittinger <cg@exept.de>
parents:
1971
diff
changeset
|
1527 |
|
617 | 1528 |
includes:something |
1529 |
"this should come from Collection. |
|
1530 |
will change the inheritance - Smalltalk is actually a collection" |
|
1531 |
||
1532 |
self do:[:element | element = something ifTrue:[^ true]]. |
|
1533 |
^ false |
|
1534 |
! |
|
1535 |
||
1706 | 1536 |
isNamespace |
1537 |
^ true |
|
1538 |
||
1539 |
"Created: 11.10.1996 / 18:10:43 / cg" |
|
1540 |
! |
|
1541 |
||
617 | 1542 |
numberOfGlobals |
1543 |
"return the number of global variables in the system" |
|
1544 |
||
1545 |
|tally "{ Class: SmallInteger }" | |
|
1546 |
||
1547 |
tally := 0. |
|
1548 |
self do:[:obj | tally := tally + 1]. |
|
1549 |
^ tally |
|
1550 |
||
1551 |
"Smalltalk numberOfGlobals" |
|
1552 |
! |
|
1553 |
||
1554 |
references:anObject |
|
1555 |
"redefined, since the references are only kept in the VM's symbol table" |
|
1556 |
||
1557 |
self keysAndValuesDo:[:key :val | |
|
2379 | 1558 |
(key == anObject) ifTrue:[^ true]. |
1559 |
(val == anObject ) ifTrue:[^ true]. |
|
617 | 1560 |
]. |
1561 |
^ super references:anObject |
|
1562 |
! |
|
1563 |
||
1564 |
referencesDerivedInstanceOf:aClass |
|
1565 |
"redefined, since the references are only kept in the VM's symbol table" |
|
1566 |
||
1567 |
self keysAndValuesDo:[:key :val | |
|
2379 | 1568 |
(key isKindOf:aClass) ifTrue:[^ true]. |
1569 |
(val isKindOf:aClass) ifTrue:[^ true]. |
|
617 | 1570 |
]. |
1571 |
^ super referencesDerivedInstanceOf:aClass |
|
1572 |
! |
|
1573 |
||
1574 |
referencesInstanceOf:aClass |
|
1575 |
"redefined, since the references are only kept in the VM's symbol table" |
|
1576 |
||
1577 |
self keysAndValuesDo:[:key :val | |
|
2379 | 1578 |
(key isMemberOf:aClass) ifTrue:[^ true]. |
1579 |
(val isMemberOf:aClass) ifTrue:[^ true]. |
|
617 | 1580 |
]. |
1581 |
^ super referencesInstanceOf:aClass |
|
1582 |
! |
|
1583 |
||
453 | 1584 |
selectorCompletion:aPartialSymbolName |
1585 |
"given a partial selector, return an array consisting of |
|
1586 |
2 entries: 1st: collection consisting of matching implemented selectors |
|
2379 | 1587 |
2nd: the longest match" |
453 | 1588 |
|
1589 |
|matches best| |
|
1590 |
||
1591 |
matches := IdentitySet new. |
|
1592 |
self allClassesDo:[:aClass | |
|
2894 | 1593 |
aClass methodDictionary keysAndValuesDo:[:aSelector :aMethod | |
2379 | 1594 |
(aSelector startsWith:aPartialSymbolName) ifTrue:[ |
1595 |
matches add:aSelector |
|
1596 |
] |
|
1597 |
]. |
|
2894 | 1598 |
aClass class methodDictionary keysAndValuesDo:[:aSelector :aMethod | |
2379 | 1599 |
(aSelector startsWith:aPartialSymbolName) ifTrue:[ |
1600 |
matches add:aSelector |
|
1601 |
] |
|
1602 |
] |
|
453 | 1603 |
]. |
1604 |
matches := matches asSortedCollection. |
|
1605 |
matches isEmpty ifTrue:[ |
|
2379 | 1606 |
^ Array with:aPartialSymbolName with:(Array with:aPartialSymbolName) |
453 | 1607 |
]. |
1608 |
matches size == 1 ifTrue:[ |
|
2379 | 1609 |
^ Array with:matches first with:(matches asArray) |
453 | 1610 |
]. |
1611 |
best := matches longestCommonPrefix. |
|
1612 |
^ Array with:best with:matches asArray |
|
1613 |
||
1614 |
" |
|
1615 |
Smalltalk selectorCompletion:'at:p' |
|
1616 |
Smalltalk selectorCompletion:'nextP' |
|
1617 |
" |
|
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1455
diff
changeset
|
1618 |
|
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1455
diff
changeset
|
1619 |
"Modified: 7.6.1996 / 08:44:33 / stefan" |
2894 | 1620 |
"Modified: 29.8.1997 / 08:00:35 / cg" |
453 | 1621 |
! ! |
1622 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1623 |
!Smalltalk class methodsFor:'startup'! |
1 | 1624 |
|
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1625 |
mainStartup:graphicalMode |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1626 |
"common start/restart action, if there is a Display, initialize it |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1627 |
and start dispatching; otherwise go into a read-eval-print loop." |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1628 |
|
2249
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1629 |
|mainProcess standAloneProcess imageName thisIsARestart| |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1630 |
|
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1631 |
imageName := ObjectMemory imageName. |
2249
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1632 |
thisIsARestart := imageName notNil. |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1633 |
|
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1634 |
" |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1635 |
if there is a display, start its event dispatcher |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1636 |
" |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1637 |
Display notNil ifTrue:[ |
2535
2484285b227d
setup a terminating Display I/O error handler.
Claus Gittinger <cg@exept.de>
parents:
2523
diff
changeset
|
1638 |
Display deviceIOErrorSignal handlerBlock:[:ex | |
2484285b227d
setup a terminating Display I/O error handler.
Claus Gittinger <cg@exept.de>
parents:
2523
diff
changeset
|
1639 |
'Display [warning]: broken display connection - exit.' infoPrintCR. |
2484285b227d
setup a terminating Display I/O error handler.
Claus Gittinger <cg@exept.de>
parents:
2523
diff
changeset
|
1640 |
Smalltalk exit. |
2484285b227d
setup a terminating Display I/O error handler.
Claus Gittinger <cg@exept.de>
parents:
2523
diff
changeset
|
1641 |
]. |
2084
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1642 |
Display startDispatch. |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1643 |
]. |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1644 |
|
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1645 |
Initializing := false. |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1646 |
|
2074
01f7e1396c18
fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents:
2050
diff
changeset
|
1647 |
"/ start a process, which evaluates all StartBlocks |
01f7e1396c18
fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents:
2050
diff
changeset
|
1648 |
"/ this used to be done right here (in this system-process), |
01f7e1396c18
fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents:
2050
diff
changeset
|
1649 |
"/ but lead to trouble, when it suspended. |
01f7e1396c18
fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents:
2050
diff
changeset
|
1650 |
"/ Therefore, it is now done by an extra user-process. |
01f7e1396c18
fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents:
2050
diff
changeset
|
1651 |
|
1650
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1652 |
mainProcess := [ |
2084
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1653 |
StartBlocks notNil ifTrue:[ |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1654 |
StartBlocks do:[:aBlock| |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1655 |
aBlock value |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1656 |
]. |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1657 |
StartBlocks := nil. |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1658 |
]. |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1659 |
ImageStartBlocks notNil ifTrue:[ |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1660 |
ImageStartBlocks do:[:aBlock| |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1661 |
aBlock value |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1662 |
]. |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1663 |
]. |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1664 |
StandAlone ifFalse:[ |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1665 |
(SilentLoading == true) ifFalse:[ "i.e. undefined counts as false" |
2249
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1666 |
thisIsARestart ifTrue:[ |
2084
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1667 |
Transcript cr. |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1668 |
Transcript showCR:('Smalltalk restarted from:' |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1669 |
, imageName |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1670 |
, ' (saved ' |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1671 |
, ObjectMemory imageSaveTime printString |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1672 |
, ')' ). |
2249
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1673 |
] ifFalse:[ |
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1674 |
Transcript showCR:(self hello). |
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1675 |
Transcript showCR:(self copyrightString). |
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1676 |
Transcript cr. |
2084
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1677 |
]. |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1678 |
Transcript cr. |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1679 |
]. |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1680 |
|
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1681 |
DemoMode ifTrue:[ |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1682 |
Transcript showCR:'*** Restricted use: ***'. |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1683 |
Transcript showCR:'*** This program may be used for education only. ***'. |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1684 |
Transcript showCR:'*** Please read the files COPYRIGHT and LICENSE ***'. |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1685 |
Transcript showCR:'*** for more details. ***'. |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1686 |
Transcript cr. |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1687 |
]. |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1688 |
]. |
2249
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1689 |
|
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1690 |
thisIsARestart ifTrue:[ |
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1691 |
"/ |
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1692 |
"/ the final late notification - users can now assume that |
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1693 |
"/ views, forms etc. have been recreated. |
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1694 |
|
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1695 |
ObjectMemory changed:#returnFromSnapshot. |
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1696 |
] |
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1697 |
|
1650
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1698 |
] newProcess. |
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1699 |
mainProcess priority:8. |
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1700 |
mainProcess name:'start block handler'. |
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1701 |
mainProcess beGroupLeader. |
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1702 |
mainProcess resume. |
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1703 |
|
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1704 |
|
2074
01f7e1396c18
fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents:
2050
diff
changeset
|
1705 |
"/ start a process, which evaluates the startupClass>>startupSelector |
01f7e1396c18
fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents:
2050
diff
changeset
|
1706 |
"/ message. |
01f7e1396c18
fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents:
2050
diff
changeset
|
1707 |
|
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1708 |
(StartupClass notNil and:[StartupSelector notNil]) ifTrue:[ |
2084
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1709 |
" |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1710 |
allow more customization by reading an image specific rc-file |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1711 |
" |
2249
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1712 |
thisIsARestart ifTrue:[ |
2907 | 1713 |
(imageName asFilename hasSuffix:'img') ifTrue:[ |
2084
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1714 |
imageName := imageName copyWithoutLast:4 |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1715 |
]. |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1716 |
self fileIn:(imageName , '.rc') |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1717 |
]. |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1718 |
|
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1719 |
"/ Display notNil ifTrue:[ |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1720 |
"/ Display class exitOnLastClose:true. |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1721 |
"/ ]. |
2086 | 1722 |
"/ Processor exitWhenNoMoreUserProcesses:true. |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1723 |
|
2084
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1724 |
standAloneProcess := [ |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1725 |
StartupClass perform:StartupSelector withArguments:StartupArguments. |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1726 |
"/ |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1727 |
"/ non-GUI apps exit after the startup; |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1728 |
"/ assume that GUI apps have created & opened some view ... |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1729 |
"/ |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1730 |
Display isNil ifTrue:[ |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1731 |
Smalltalk exit. |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1732 |
]. |
2086 | 1733 |
"/ |
1734 |
"/ GUI apps exit after the last user process has finished |
|
1735 |
"/ |
|
1736 |
Display class exitOnLastClose:true. |
|
1737 |
Processor exitWhenNoMoreUserProcesses:true. |
|
2084
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1738 |
] newProcess. |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1739 |
standAloneProcess priority:8. |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1740 |
standAloneProcess name:'main'. |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1741 |
standAloneProcess beGroupLeader. |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1742 |
standAloneProcess resume. |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1743 |
]. |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1744 |
|
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1745 |
" |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1746 |
if view-classes exist, start dispatching; |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1747 |
otherwise go into a read-eval-print loop |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1748 |
" |
2074
01f7e1396c18
fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents:
2050
diff
changeset
|
1749 |
((Display notNil and:[graphicalMode]) or:[standAloneProcess notNil]) ifTrue:[ |
2084
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1750 |
Processor dispatchLoop. |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1751 |
] ifFalse:[ |
2084
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1752 |
StandAlone ifFalse:[ |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1753 |
self readEvalPrint |
c3342f5d6461
exitOnLastClose is bad here (INSTALLER)
Claus Gittinger <cg@exept.de>
parents:
2083
diff
changeset
|
1754 |
] |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1755 |
]. |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1756 |
|
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1757 |
"done - the last process finished" |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1758 |
|
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1759 |
self exit |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1760 |
|
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1761 |
"Created: 18.7.1996 / 21:07:39 / cg" |
1650
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1762 |
"Modified: 9.9.1996 / 17:42:50 / stefan" |
2535
2484285b227d
setup a terminating Display I/O error handler.
Claus Gittinger <cg@exept.de>
parents:
2523
diff
changeset
|
1763 |
"Modified: 11.4.1997 / 13:39:06 / cg" |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1764 |
! |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1765 |
|
453 | 1766 |
readEvalPrint |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1767 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
1768 |
|
453 | 1769 |
"simple read-eval-print loop for non-graphical Minitalk" |
1770 |
||
1771 |
|text| |
|
1772 |
||
1773 |
'ST- ' print. |
|
1774 |
Stdin skipSeparators. |
|
1775 |
Stdin atEnd ifFalse:[ |
|
2379 | 1776 |
text := Stdin nextChunk. |
1777 |
[text notNil] whileTrue:[ |
|
2588
090cf1da8036
handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents:
2572
diff
changeset
|
1778 |
AbortSignal handle:[:ex | |
090cf1da8036
handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents:
2572
diff
changeset
|
1779 |
'evaluation aborted' printCR |
090cf1da8036
handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents:
2572
diff
changeset
|
1780 |
] do:[ |
090cf1da8036
handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents:
2572
diff
changeset
|
1781 |
(Compiler evaluate:text) printCR. |
090cf1da8036
handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents:
2572
diff
changeset
|
1782 |
]. |
2379 | 1783 |
'ST- ' print. |
1784 |
text := Stdin nextChunk |
|
1785 |
]. |
|
453 | 1786 |
]. |
2588
090cf1da8036
handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents:
2572
diff
changeset
|
1787 |
'' printCR |
453 | 1788 |
! |
1789 |
||
1 | 1790 |
restart |
24 | 1791 |
"startup after an image has been loaded; |
10 | 1792 |
there are three change-notifications made to dependents of ObjectMemory, |
1793 |
which allow a stepwise re-init: #earlyRestart, #restarted and #returnFromSnapshot. |
|
335 | 1794 |
|
10 | 1795 |
#earlyRestart is send first, nothing has been setup yet. |
2249
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1796 |
(should be used to flush all device dependent entries) |
335 | 1797 |
|
10 | 1798 |
#restarted is send right after. |
2249
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1799 |
(should be used to recreate external resources (fds, bitmaps etc) |
335 | 1800 |
|
10 | 1801 |
#returnFromSnapshot is sent last |
2249
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1802 |
(should be used to restart processes, reOpen Streams which cannot |
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1803 |
be automatically be reopened (i.e. Sockets, Pipes) and so on. |
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1804 |
(Notice that positionable fileStreams are already reopened and repositioned) |
1 | 1805 |
" |
10 | 1806 |
|
1581 | 1807 |
|deb insp idx| |
1 | 1808 |
|
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1809 |
"/ |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1810 |
"/ when we arrive here, all objects from our previous life |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1811 |
"/ have been reloaded - however, these contain invalid device |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1812 |
"/ handles, display information etc. |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1813 |
"/ also, dynamically loaded modules have not yet been reloaded. |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1814 |
|
1 | 1815 |
Initializing := true. |
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
1816 |
ImageRestartTime := AbsoluteTime now. |
335 | 1817 |
|
1580
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
1818 |
CommandLine := CommandLineArguments copy. |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
1819 |
CommandLineArguments := CommandLineArguments asOrderedCollection. |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
1820 |
CommandLineArguments removeAtIndex:1. "/ the command |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
1821 |
|
1582 | 1822 |
idx := CommandLineArguments indexOf:'-q'. |
1823 |
idx ~~ 0 ifTrue:[ |
|
2249
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1824 |
Object infoPrinting:false. |
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1825 |
ObjectMemory infoPrinting:false. |
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1826 |
CommandLineArguments removeAtIndex:idx. |
1582 | 1827 |
]. |
1828 |
||
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1829 |
"/ |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1830 |
"/ invalidate the display connection. |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1831 |
"/ This is required to avoid trouble if someone accesses |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1832 |
"/ the Display during early startup. |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1833 |
|
684
3e0b5a8ec381
invalidate display connection during early startup
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
1834 |
Display notNil ifTrue:[ |
2535
2484285b227d
setup a terminating Display I/O error handler.
Claus Gittinger <cg@exept.de>
parents:
2523
diff
changeset
|
1835 |
Display class allScreens do:[:aDisplay | |
2484285b227d
setup a terminating Display I/O error handler.
Claus Gittinger <cg@exept.de>
parents:
2523
diff
changeset
|
1836 |
aDisplay invalidateConnection |
2484285b227d
setup a terminating Display I/O error handler.
Claus Gittinger <cg@exept.de>
parents:
2523
diff
changeset
|
1837 |
]. |
684
3e0b5a8ec381
invalidate display connection during early startup
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
1838 |
]. |
3e0b5a8ec381
invalidate display connection during early startup
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
1839 |
|
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1840 |
"/ |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1841 |
"/ start catching SIGSEGV and SIGBUS |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1842 |
|
684
3e0b5a8ec381
invalidate display connection during early startup
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
1843 |
OperatingSystem enableHardSignalInterrupts. |
3e0b5a8ec381
invalidate display connection during early startup
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
1844 |
|
2907 | 1845 |
"/ reinit Filename |
1846 |
Filename reinitialize. |
|
1847 |
||
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1848 |
"/ |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1849 |
"/ flush cached path directories (may have changed in the meanwhile) |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1850 |
|
329 | 1851 |
self flushPathCaches. |
1 | 1852 |
|
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1853 |
"/ |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1854 |
"/ reinit the default streams: Stdin, Stdout and Stderr |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1855 |
"/ after that, we can write to stderr. |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1856 |
|
477
8710aba7876b
oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents:
457
diff
changeset
|
1857 |
self reinitStandardStreams. |
8710aba7876b
oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents:
457
diff
changeset
|
1858 |
|
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1859 |
"/ |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1860 |
"/ temporary switch back to dumb interface - |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1861 |
"/ to handle errors while view-stuff is not yet reinitialized" |
1 | 1862 |
|
1863 |
insp := Inspector. |
|
1864 |
deb := Debugger. |
|
684
3e0b5a8ec381
invalidate display connection during early startup
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
1865 |
deb notNil ifTrue:[ |
2249
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1866 |
deb reinitialize |
684
3e0b5a8ec381
invalidate display connection during early startup
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
1867 |
]. |
1 | 1868 |
Inspector := MiniInspector. |
1869 |
Debugger := MiniDebugger. |
|
1870 |
||
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1871 |
"/ |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1872 |
"/ reload any dynamically loaded objects. |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1873 |
"/ this must be done before doing anything else below, |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1874 |
"/ because the Processor may restart processes which use |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1875 |
"/ this code. |
335 | 1876 |
|
1100
eebf3ed54b23
reloadAllObjectFiles now called explicit (its too late via ObjMem changed)
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1877 |
ObjectFileLoader notNil ifTrue:[ |
2249
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1878 |
ObjectFileLoader reloadAllRememberedObjectFiles. |
1100
eebf3ed54b23
reloadAllObjectFiles now called explicit (its too late via ObjMem changed)
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1879 |
]. |
eebf3ed54b23
reloadAllObjectFiles now called explicit (its too late via ObjMem changed)
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1880 |
|
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1881 |
"/ |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1882 |
"/ reinitialize the Processor - restartable processes |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1883 |
"/ are now prepared to restart, when the dispatch starts. |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1884 |
"/ |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1885 |
Processor reinitialize. |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1886 |
|
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1887 |
"/ |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1888 |
"/ flush device handles & recreate OS resources (if possible) |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1889 |
"/ (mostly view/GC/color & font stuff) |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1890 |
|
3022 | 1891 |
ObjectMemory |
1892 |
changed:#earlyRestart; changed:#restarted. |
|
1 | 1893 |
|
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1894 |
"/ |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1895 |
"/ some class must be reinitialized before all others ... |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1896 |
"/ - sorry, but order is important |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1897 |
"/ |
62 | 1898 |
Workstation notNil ifTrue:[ |
2249
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1899 |
Workstation reinitialize. |
62 | 1900 |
]. |
1 | 1901 |
|
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1902 |
"/ |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1903 |
"/ start catching SIGINT and SIGQUIT |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1904 |
|
684
3e0b5a8ec381
invalidate display connection during early startup
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
1905 |
OperatingSystem enableUserInterrupts. |
3e0b5a8ec381
invalidate display connection during early startup
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
1906 |
|
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1907 |
"/ |
2249
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1908 |
"/ done later now - when display connection is working |
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1909 |
"/ |
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1910 |
"/ "/ |
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1911 |
"/ "/ the final late notification - users can now assume that |
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1912 |
"/ "/ views, forms etc. have been recreated. |
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1913 |
"/ |
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1914 |
"/ ObjectMemory changed:#returnFromSnapshot. |
1 | 1915 |
|
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1916 |
"/ now, display and view-stuff works; |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1917 |
"/ back to the previous debugging interface |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1918 |
|
1 | 1919 |
Inspector := insp. |
1920 |
Debugger := deb. |
|
1921 |
||
1922 |
Initializing := false. |
|
1923 |
||
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1924 |
"/ |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1925 |
"/ if there is no Transcript, go to stderr |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1926 |
|
1 | 1927 |
Transcript isNil ifTrue:[ |
2249
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1928 |
Transcript := Stderr |
1 | 1929 |
]. |
1930 |
||
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1931 |
"/ give user a chance to re-customize things |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1932 |
"/ reading if smalltalk_r.rc may be suppressed by the |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1933 |
"/ -fastStart argument. |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
1934 |
|
1580
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
1935 |
idx := CommandLineArguments indexOf:'-faststart'. |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
1936 |
idx ~~ 0 ifTrue:[ |
2249
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1937 |
CommandLineArguments removeAtIndex:idx. |
1580
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
1938 |
] ifFalse:[ |
2249
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1939 |
Class withoutUpdatingChangesDo:[ |
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1940 |
(self fileIn:(self commandName , '_r.rc')) ifFalse:[ |
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1941 |
"no _r.rc file where executable is; try default smalltalk_r.rc" |
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1942 |
self fileIn:'smalltalk_r.rc' |
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1943 |
]. |
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
1944 |
] |
7 | 1945 |
]. |
1946 |
||
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1947 |
self mainStartup:true |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
1948 |
|
2907 | 1949 |
"Modified: 7.9.1997 / 23:35:33 / cg" |
1 | 1950 |
! |
1951 |
||
617 | 1952 |
start |
1953 |
"main startup, if there is a Display, initialize it |
|
1954 |
and start dispatching; otherwise go into a read-eval-print loop." |
|
1955 |
||
2075
85e8e9cfebd3
allow standAlone apps to be mini-debugged with '-debug' flag
Claus Gittinger <cg@exept.de>
parents:
2074
diff
changeset
|
1956 |
|idx graphicalMode arg debuggingStandAlone| |
960
e3b75f50d0cd
changes for standAlone operation
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
1957 |
|
e3b75f50d0cd
changes for standAlone operation
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
1958 |
graphicalMode := true. |
2075
85e8e9cfebd3
allow standAlone apps to be mini-debugged with '-debug' flag
Claus Gittinger <cg@exept.de>
parents:
2074
diff
changeset
|
1959 |
debuggingStandAlone := false. |
617 | 1960 |
Initializing := true. |
1961 |
||
1580
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
1962 |
CommandLine := CommandLineArguments copy. |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
1963 |
CommandLineArguments := CommandLineArguments asOrderedCollection. |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
1964 |
CommandLineArguments removeAtIndex:1. "/ the command |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
1965 |
|
963
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
1966 |
"/ |
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
1967 |
"/ turn off info messages in standAlone app |
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
1968 |
"/ |
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
1969 |
StandAlone ifTrue:[ |
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
1970 |
InfoPrinting := false. |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
1971 |
ObjectMemory infoPrinting:false. |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
1972 |
idx := CommandLineArguments indexOf:'-debug'. |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
1973 |
idx ~~ 0 ifTrue:[ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
1974 |
CommandLineArguments removeAtIndex:idx. |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
1975 |
debuggingStandAlone := true |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
1976 |
] |
963
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
1977 |
]. |
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
1978 |
|
617 | 1979 |
" |
1980 |
while reading patches- and rc-file, do not add things into change-file |
|
1981 |
" |
|
1982 |
Class withoutUpdatingChangesDo:[ |
|
2959 | 1983 |
|myName defaultRC prevCatchSetting| |
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
1984 |
|
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
1985 |
"/ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
1986 |
"/ look for any '-q', '-e' or '-f' command line arguments |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
1987 |
"/ and handle them; |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
1988 |
"/ read startup and patches file |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
1989 |
"/ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
1990 |
idx := CommandLineArguments indexOf:'-q'. |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
1991 |
idx ~~ 0 ifTrue:[ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
1992 |
Object infoPrinting:false. |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
1993 |
ObjectMemory infoPrinting:false. |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
1994 |
CommandLineArguments removeAtIndex:idx. |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
1995 |
]. |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
1996 |
|
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
1997 |
StandAlone ifFalse:[ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
1998 |
"/ look for a '-e filename' argument - this will force evaluation of |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
1999 |
"/ filename only, no standard startup |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2000 |
|
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2001 |
idx := CommandLineArguments indexOf:'-e'. |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2002 |
idx ~~ 0 ifTrue:[ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2003 |
arg := CommandLineArguments at:idx + 1. |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2004 |
|
3021 | 2005 |
CommandLineArguments |
2006 |
removeAtIndex:idx+1; removeAtIndex:idx. |
|
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2007 |
|
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2008 |
arg = '-' ifTrue:[ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2009 |
self fileInStream:Stdin |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2010 |
lazy:nil |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2011 |
silent:nil |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2012 |
logged:false |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2013 |
addPath:nil |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2014 |
] ifFalse:[ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2015 |
self fileIn:arg. |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2016 |
]. |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2017 |
self exit |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2018 |
]. |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2019 |
]. |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2020 |
|
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2021 |
"/ if there is a <command>.pch, that patches file is read. |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2022 |
"/ otherwise, look for a patches file. |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2023 |
"/ BUT: the patches file is not read in StandAlone operation |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2024 |
|
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2025 |
myName := self commandName. |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2026 |
|
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2027 |
"/ look for a '-f filename' argument - this will force evaluation of |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2028 |
"/ filename instead of smalltalk.rc |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2029 |
|
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2030 |
idx := CommandLineArguments indexOf:'-f'. |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2031 |
idx ~~ 0 ifTrue:[ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2032 |
myName := (CommandLineArguments at:idx + 1). |
3021 | 2033 |
CommandLineArguments |
2034 |
removeAtIndex:idx+1; removeAtIndex:idx. |
|
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2035 |
]. |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2036 |
|
2959 | 2037 |
"/ patches are installed, even if system methods are |
2038 |
"/ overwritten. |
|
2039 |
||
2040 |
prevCatchSetting := Class catchMethodRedefinitions. |
|
2041 |
Class catchMethodRedefinitions:false. |
|
2042 |
||
2043 |
(self secureFileIn:(myName asFilename withSuffix:'pch')) ifFalse:[ |
|
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2044 |
StandAlone ifFalse:[ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2045 |
self secureFileIn:'patches'. |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2046 |
]. |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2047 |
]. |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2048 |
|
2959 | 2049 |
Class catchMethodRedefinitions:prevCatchSetting. |
2050 |
||
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2051 |
"/ then look for <command>.rc |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2052 |
"/ if not found, read smalltalk.rc (or stxapp.rc for standAlone operation) |
935
4317f75fa478
dont allow setting the loadBinaries flag, if there is no ObjectFileLoader
Claus Gittinger <cg@exept.de>
parents:
908
diff
changeset
|
2053 |
|
2959 | 2054 |
(self secureFileIn:(myName asFilename withSuffix:'rc')) ifFalse:[ |
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2055 |
StandAlone ifFalse:[ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2056 |
defaultRC := 'smalltalk.rc' |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2057 |
] ifTrue:[ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2058 |
defaultRC := 'stxapp.rc' |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2059 |
]. |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2060 |
|
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2061 |
"/ no .rc file where executable is; try default smalltalk.rc (or stxapp.rc) |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2062 |
|
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2063 |
(self secureFileIn:defaultRC) ifFalse:[ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2064 |
StandAlone ifFalse:[ |
2127 | 2065 |
'Smalltalk [warning]: no startup rc-file found. Going into line-by-line interpreter.' infoPrintCR. |
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2066 |
graphicalMode := false. |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2067 |
] |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2068 |
] |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2069 |
]. |
617 | 2070 |
]. |
2071 |
||
963
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
2072 |
StandAlone ifTrue:[ |
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2073 |
Debugger := Inspector := nil. |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2074 |
debuggingStandAlone ifTrue:[ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2075 |
Debugger := MiniDebugger. |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2076 |
]. |
963
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
2077 |
] ifFalse:[ |
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2078 |
" |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2079 |
enable the graphical debugger/inspector |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2080 |
(they could have been (re)defined as autoloaded in the patches file) |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2081 |
" |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2082 |
self initStandardTools. |
963
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
2083 |
]. |
617 | 2084 |
|
2074
01f7e1396c18
fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents:
2050
diff
changeset
|
2085 |
Display isNil ifTrue:[ |
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
2086 |
graphicalMode := false. |
2074
01f7e1396c18
fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents:
2050
diff
changeset
|
2087 |
]. |
01f7e1396c18
fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents:
2050
diff
changeset
|
2088 |
|
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2089 |
self mainStartup:graphicalMode |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2090 |
|
2127 | 2091 |
"Modified: 10.1.1997 / 17:24:37 / cg" |
1097 | 2092 |
! ! |
2093 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
2094 |
!Smalltalk class methodsFor:'startup queries'! |
1097 | 2095 |
|
1580
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2096 |
commandLine |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2097 |
"return the full command line arguments (with which ST/X was started)" |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2098 |
|
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2099 |
^ CommandLine |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2100 |
|
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2101 |
"Created: 19.7.1996 / 11:09:06 / cg" |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2102 |
! |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2103 |
|
1097 | 2104 |
commandLineArguments |
1580
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2105 |
"return the user command line arguments; |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2106 |
This is a collection of strings (separated command line words), |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2107 |
from which the internal startup arguments have already been removed. |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2108 |
I.e. if started with: 'smalltalk -I -f xxx foo bar baz', |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2109 |
the commandLineArguments will be #('foo' 'bar' 'baz'). |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2110 |
In contrast, the value returned by #commandLine will be the full set of words." |
1097 | 2111 |
|
2112 |
^ CommandLineArguments |
|
1580
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2113 |
|
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2114 |
"Modified: 19.7.1996 / 11:11:03 / cg" |
1097 | 2115 |
! |
2116 |
||
2117 |
commandName |
|
2118 |
"return the excutables name - this is normally 'smalltalk', but |
|
1580
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2119 |
can be something else for standAlone apps." |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2120 |
|
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2121 |
^ CommandLine at:1. |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2122 |
|
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2123 |
"Modified: 19.7.1996 / 11:11:16 / cg" |
1097 | 2124 |
! |
2125 |
||
2126 |
isStandAloneApp |
|
2127 |
"return true, if this is a standAlone application |
|
2128 |
(in contrast to a full smalltalk system)." |
|
2129 |
||
2130 |
^ StandAlone |
|
617 | 2131 |
! |
2132 |
||
2133 |
startupArguments |
|
2134 |
"return the arguments passed to StartupClass" |
|
2135 |
||
2136 |
^ StartupArguments |
|
70 | 2137 |
! |
2138 |
||
2139 |
startupClass |
|
2140 |
"return the class, that will get the start message when smalltalk |
|
2141 |
starts and its non-nil. Usually this is nil, but saving an image |
|
2142 |
with a non-nil StartupClass allows stand-alone applications" |
|
2143 |
||
2144 |
^ StartupClass |
|
2145 |
! |
|
2146 |
||
617 | 2147 |
startupClass:aClass selector:aSymbol arguments:anArrayOrNil |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
2148 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
2149 |
|
617 | 2150 |
"set the class, selector and arguments to be performed when smalltalk |
2151 |
starts. Setting those before saving a snapshot, will make the saved |
|
2152 |
image come up executing your application (instead of the normal mainloop)" |
|
2153 |
||
2154 |
StartupClass := aClass. |
|
2155 |
StartupSelector := aSymbol. |
|
2156 |
StartupArguments := anArrayOrNil |
|
2157 |
! |
|
2158 |
||
70 | 2159 |
startupSelector |
2160 |
"return the selector, that will be sent to StartupClass" |
|
2161 |
||
2162 |
^ StartupSelector |
|
2163 |
! ! |
|
2164 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
2165 |
!Smalltalk class methodsFor:'system environment'! |
1069 | 2166 |
|
2167 |
language |
|
2168 |
"return the language setting" |
|
2169 |
||
2170 |
^ Language |
|
1307 | 2171 |
|
2172 |
" |
|
2173 |
Smalltalk language |
|
2174 |
" |
|
2175 |
||
2176 |
"Modified: 26.4.1996 / 17:10:05 / cg" |
|
2177 |
! |
|
2178 |
||
2179 |
language:aLanguageSymbol |
|
2180 |
"set the language" |
|
2181 |
||
2182 |
Language := aLanguageSymbol. |
|
2183 |
self changed:#Language |
|
2184 |
||
2185 |
" |
|
2186 |
Smalltalk language:#de |
|
2187 |
" |
|
2188 |
||
2189 |
"Modified: 26.4.1996 / 17:13:34 / cg" |
|
1069 | 2190 |
! |
2191 |
||
2192 |
languageTerritory |
|
2193 |
"return the language territory setting" |
|
2194 |
||
2195 |
^ LanguageTerritory |
|
1307 | 2196 |
! |
2197 |
||
2198 |
languageTerritory:aTerritorySymbol |
|
2199 |
"set the language territory" |
|
2200 |
||
2201 |
LanguageTerritory := aTerritorySymbol. |
|
2202 |
self changed:#LanguageTerritory |
|
2203 |
||
2204 |
" |
|
2205 |
Time now |
|
2206 |
||
2207 |
Smalltalk languageTerritory:#us. |
|
2208 |
Time now |
|
2209 |
||
2210 |
Smalltalk languageTerritory:#de. |
|
2211 |
Time now |
|
2212 |
" |
|
2213 |
||
2214 |
"Modified: 26.4.1996 / 17:12:39 / cg" |
|
1069 | 2215 |
! ! |
2216 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
2217 |
!Smalltalk class methodsFor:'system management'! |
70 | 2218 |
|
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
456
diff
changeset
|
2219 |
bitmapFileStreamFor:aFileName |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
456
diff
changeset
|
2220 |
"search aFileName in some standard places; |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
456
diff
changeset
|
2221 |
return a readonly fileStream or nil if not found. |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
456
diff
changeset
|
2222 |
Searches in subdirectories named 'bitmaps' in SystemPath" |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
456
diff
changeset
|
2223 |
|
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
456
diff
changeset
|
2224 |
|aString| |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
456
diff
changeset
|
2225 |
|
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
456
diff
changeset
|
2226 |
aString := self getBitmapFileName:aFileName. |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
456
diff
changeset
|
2227 |
aString notNil ifTrue:[ |
2928 | 2228 |
^ aString asFilename readStream |
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
456
diff
changeset
|
2229 |
]. |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
456
diff
changeset
|
2230 |
^ nil |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
456
diff
changeset
|
2231 |
! |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
456
diff
changeset
|
2232 |
|
2 | 2233 |
classNameForFile:aFileName |
10 | 2234 |
"return the className which corresponds to an abbreviated fileName, |
736 | 2235 |
or nil if no special translation applies. The given filename arg may |
2236 |
include a '.st' suffix (but no other)." |
|
2237 |
||
2238 |
|fn| |
|
2239 |
||
2907 | 2240 |
(aFileName asFilename hasSuffix:'st') ifTrue:[ |
2379 | 2241 |
fn := aFileName copyWithoutLast:3 |
736 | 2242 |
] ifFalse:[ |
2379 | 2243 |
fn := aFileName |
736 | 2244 |
]. |
2245 |
^ self filenameAbbreviations keyAtEqualValue:fn ifAbsent:[fn]. |
|
2 | 2246 |
|
329 | 2247 |
" |
736 | 2248 |
Smalltalk classNameForFile:'DrawObj' |
2249 |
Smalltalk classNameForFile:'DrawObj.st' |
|
2250 |
Smalltalk classNameForFile:'ArrColl.st' |
|
2251 |
Smalltalk classNameForFile:'ArrColl.chg' |
|
329 | 2252 |
" |
736 | 2253 |
|
2254 |
"Modified: 11.12.1995 / 14:51:10 / cg" |
|
2 | 2255 |
! |
2256 |
||
617 | 2257 |
compressSources |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
2258 |
"{ Pragma: +optSpace }" |
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
2259 |
|
617 | 2260 |
"compress the sources file, and remove all method source strings |
2261 |
from the system and replace them by refs to a string in the source file. |
|
2262 |
This is a bit different in ST/X than in other smalltalks, |
|
2263 |
since we use per-class sourcefiles for the compiled classes, |
|
2264 |
and a mix of in-memory strings and one-for-all sourceFile for |
|
2265 |
incremental compiled methods. |
|
2266 |
Therefore, only those sources which are not coming from compiled |
|
2267 |
methods are put into the 'st.src' file - all others are untouched. |
|
2268 |
This is being automated - so dont care for now." |
|
2269 |
||
2270 |
" |
|
2271 |
first, find all methods which contain either a string-ref |
|
2272 |
or an external string in the 'st.src' file |
|
2273 |
" |
|
2274 |
|newStream table source pos fileName| |
|
2275 |
||
2276 |
newStream := 'src.tmp' asFilename writeStream. |
|
2277 |
newStream isNil ifTrue:[ |
|
2176
1a24b0cef25a
when compressing sources, make certain to avoid later
Claus Gittinger <cg@exept.de>
parents:
2170
diff
changeset
|
2278 |
self error:'cannot create new temporary source file'. |
1a24b0cef25a
when compressing sources, make certain to avoid later
Claus Gittinger <cg@exept.de>
parents:
2170
diff
changeset
|
2279 |
^ self |
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
456
diff
changeset
|
2280 |
]. |
617 | 2281 |
|
2282 |
table := IdentityDictionary new:100. |
|
2283 |
||
2284 |
Method allSubInstancesDo:[:aMethod | |
|
2176
1a24b0cef25a
when compressing sources, make certain to avoid later
Claus Gittinger <cg@exept.de>
parents:
2170
diff
changeset
|
2285 |
source := nil. |
1a24b0cef25a
when compressing sources, make certain to avoid later
Claus Gittinger <cg@exept.de>
parents:
2170
diff
changeset
|
2286 |
aMethod sourcePosition notNil ifTrue:[ |
1a24b0cef25a
when compressing sources, make certain to avoid later
Claus Gittinger <cg@exept.de>
parents:
2170
diff
changeset
|
2287 |
aMethod sourceFilename = 'st.src' ifTrue:[ |
1a24b0cef25a
when compressing sources, make certain to avoid later
Claus Gittinger <cg@exept.de>
parents:
2170
diff
changeset
|
2288 |
source := aMethod source. |
1a24b0cef25a
when compressing sources, make certain to avoid later
Claus Gittinger <cg@exept.de>
parents:
2170
diff
changeset
|
2289 |
] |
1a24b0cef25a
when compressing sources, make certain to avoid later
Claus Gittinger <cg@exept.de>
parents:
2170
diff
changeset
|
2290 |
] ifFalse:[ |
1a24b0cef25a
when compressing sources, make certain to avoid later
Claus Gittinger <cg@exept.de>
parents:
2170
diff
changeset
|
2291 |
source := aMethod source |
1a24b0cef25a
when compressing sources, make certain to avoid later
Claus Gittinger <cg@exept.de>
parents:
2170
diff
changeset
|
2292 |
]. |
1a24b0cef25a
when compressing sources, make certain to avoid later
Claus Gittinger <cg@exept.de>
parents:
2170
diff
changeset
|
2293 |
|
1a24b0cef25a
when compressing sources, make certain to avoid later
Claus Gittinger <cg@exept.de>
parents:
2170
diff
changeset
|
2294 |
source notNil ifTrue:[ |
1a24b0cef25a
when compressing sources, make certain to avoid later
Claus Gittinger <cg@exept.de>
parents:
2170
diff
changeset
|
2295 |
pos := newStream position. |
1a24b0cef25a
when compressing sources, make certain to avoid later
Claus Gittinger <cg@exept.de>
parents:
2170
diff
changeset
|
2296 |
newStream nextChunkPut:source. |
1a24b0cef25a
when compressing sources, make certain to avoid later
Claus Gittinger <cg@exept.de>
parents:
2170
diff
changeset
|
2297 |
|
1a24b0cef25a
when compressing sources, make certain to avoid later
Claus Gittinger <cg@exept.de>
parents:
2170
diff
changeset
|
2298 |
" |
1a24b0cef25a
when compressing sources, make certain to avoid later
Claus Gittinger <cg@exept.de>
parents:
2170
diff
changeset
|
2299 |
dont change the methods info - maybe some write error |
1a24b0cef25a
when compressing sources, make certain to avoid later
Claus Gittinger <cg@exept.de>
parents:
2170
diff
changeset
|
2300 |
occurs later, in that case we abort and leave everything |
1a24b0cef25a
when compressing sources, make certain to avoid later
Claus Gittinger <cg@exept.de>
parents:
2170
diff
changeset
|
2301 |
untouched. |
1a24b0cef25a
when compressing sources, make certain to avoid later
Claus Gittinger <cg@exept.de>
parents:
2170
diff
changeset
|
2302 |
" |
1a24b0cef25a
when compressing sources, make certain to avoid later
Claus Gittinger <cg@exept.de>
parents:
2170
diff
changeset
|
2303 |
table at:aMethod put:pos |
1a24b0cef25a
when compressing sources, make certain to avoid later
Claus Gittinger <cg@exept.de>
parents:
2170
diff
changeset
|
2304 |
] |
617 | 2305 |
]. |
2306 |
||
2307 |
newStream close. |
|
2308 |
||
2309 |
" |
|
2310 |
now, rename the new source file, |
|
2311 |
" |
|
2312 |
fileName := (ObjectMemory nameForSources). |
|
1693 | 2313 |
'src.tmp' asFilename renameTo:fileName. |
617 | 2314 |
|
2315 |
"good - now go over all changed methods, and change their |
|
2316 |
source reference" |
|
2317 |
||
2318 |
table keysAndValuesDo:[:aMethod :pos | |
|
2176
1a24b0cef25a
when compressing sources, make certain to avoid later
Claus Gittinger <cg@exept.de>
parents:
2170
diff
changeset
|
2319 |
aMethod localSourceFilename:fileName position:pos. |
2588
090cf1da8036
handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents:
2572
diff
changeset
|
2320 |
"/ aMethod printCR. |
617 | 2321 |
]. |
2322 |
||
2323 |
" |
|
2324 |
Smalltalk compressSources |
|
2325 |
" |
|
1693 | 2326 |
|
2176
1a24b0cef25a
when compressing sources, make certain to avoid later
Claus Gittinger <cg@exept.de>
parents:
2170
diff
changeset
|
2327 |
"Modified: 16.1.1997 / 01:25:58 / cg" |
617 | 2328 |
! |
2329 |
||
2330 |
constructPathFor:aDirectoryName |
|
2928 | 2331 |
"search for aDirectory in SystemPath; |
2332 |
return a collection of pathes which include that directory." |
|
617 | 2333 |
|
2334 |
^ self realSystemPath select:[:dirName | |
|
2928 | 2335 |
|fullPath| |
2336 |
||
2337 |
fullPath := dirName asFilename construct:aDirectoryName. |
|
2338 |
"/ fullPath exists and:[fullPath isDirectory and:[fullPath isReadable]] |
|
2339 |
fullPath isDirectory and:[fullPath isReadable] |
|
617 | 2340 |
]. |
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
456
diff
changeset
|
2341 |
! |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
456
diff
changeset
|
2342 |
|
1 | 2343 |
fileInChanges |
2344 |
"read in the last changes file - bringing the system to the state it |
|
70 | 2345 |
had when left the last time. |
2346 |
WARNING: this method is rubbish: it should only read things after the |
|
2379 | 2347 |
last '**snapshot**' - entry |
2348 |
(instead of the complete changes file)." |
|
1 | 2349 |
|
70 | 2350 |
" |
400 | 2351 |
do NOT update the changes file now ... |
70 | 2352 |
" |
2928 | 2353 |
self fileIn:ChangeFileName logged:false |
1 | 2354 |
|
77 | 2355 |
" |
2356 |
Smalltalk fileInChanges |
|
2357 |
" |
|
1 | 2358 |
! |
2359 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
2360 |
fileInFileStreamFor:aFileName |
617 | 2361 |
"search aFileName in some standard places; |
2362 |
return a readonly fileStream or nil if not found. |
|
2363 |
Searches in subdirectories named 'fileIn' in SystemPath" |
|
2364 |
||
2365 |
|aString| |
|
2366 |
||
2367 |
aString := self getFileInFileName:aFileName. |
|
2368 |
aString notNil ifTrue:[ |
|
2928 | 2369 |
^ aString asFilename readStream |
617 | 2370 |
]. |
2371 |
^ nil |
|
2372 |
! |
|
2373 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
2374 |
fileInStream:aStream lazy:lazy silent:silent logged:logged addPath:morePath |
617 | 2375 |
"read sourceCode from aStream; |
2376 |
return true if ok, false if failed. |
|
878
c09b016c6674
do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents:
857
diff
changeset
|
2377 |
If lazy is true, no code is generated for methods, instead stubs |
617 | 2378 |
are created which compile themself when first executed. This allows |
2379 |
for much faster fileIn (but slows down the first execution later). |
|
2380 |
Since no syntax checks are done when doing lazy fileIn, use this only for |
|
2381 |
code which is known to be syntactically correct. |
|
2382 |
If silent is true, no compiler messages are output to the transcript. |
|
2383 |
Giving nil for silent/lazy will use the current settings. |
|
2384 |
If morePath is nonNil, it is prepended to the systemPath temporarily during the |
|
2385 |
fileIn. This allows for st-expressions to refer to more files (i.e. fileIn more) |
|
2386 |
using a relative path." |
|
2387 |
||
2388 |
|wasLazy wasSilent oldSystemPath oldRealPath| |
|
2389 |
||
2390 |
aStream isNil ifTrue:[^ false]. |
|
2391 |
||
2392 |
lazy notNil ifTrue:[wasLazy := Compiler compileLazy:lazy]. |
|
2393 |
silent notNil ifTrue:[wasSilent := self silentLoading:silent]. |
|
2394 |
[ |
|
2379 | 2395 |
Class updateChangeFileQuerySignal answer:logged do:[ |
2396 |
oldSystemPath := SystemPath copy. |
|
2397 |
morePath notNil ifTrue:[ |
|
2398 |
SystemPath addFirst:morePath. |
|
2399 |
oldRealPath := RealSystemPath. |
|
2400 |
RealSystemPath := nil. |
|
2401 |
]. |
|
2402 |
aStream fileIn |
|
2403 |
] |
|
617 | 2404 |
] valueNowOrOnUnwindDo:[ |
2379 | 2405 |
morePath notNil ifTrue:[ |
2406 |
SystemPath := oldSystemPath. |
|
2407 |
RealSystemPath := oldRealPath. |
|
2408 |
]. |
|
2409 |
lazy notNil ifTrue:[Compiler compileLazy:wasLazy]. |
|
2410 |
silent notNil ifTrue:[self silentLoading:wasSilent]. |
|
2411 |
aStream close |
|
617 | 2412 |
]. |
2413 |
^ true |
|
2414 |
||
2415 |
" |
|
2416 |
Smalltalk fileInStream:('source/TicTacToe.st' asFilename readStream) lazy:true silent:true |
|
2417 |
" |
|
1896 | 2418 |
|
2419 |
"Modified: 5.11.1996 / 20:03:35 / cg" |
|
617 | 2420 |
! |
2421 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
2422 |
fileNameForClass:aClassOrClassName |
617 | 2423 |
"return a good filename for aClassOrClassName - |
2424 |
using the abbreviation file if there is one" |
|
2425 |
||
2426 |
|fileName abbrev aClassName| |
|
2427 |
||
2428 |
||
2429 |
aClassOrClassName isBehavior ifTrue:[ |
|
2379 | 2430 |
aClassOrClassName isMeta ifTrue:[ |
2431 |
aClassName := aClassOrClassName soleInstance name |
|
2432 |
] ifFalse:[ |
|
2433 |
aClassName := aClassOrClassName name |
|
2434 |
] |
|
617 | 2435 |
] ifFalse:[ |
2379 | 2436 |
aClassName := aClassOrClassName |
617 | 2437 |
]. |
2438 |
||
2439 |
fileName := aClassName asSymbol. |
|
2440 |
||
2441 |
"first look, if the class exists and has a fileName" |
|
2442 |
||
2443 |
" later ... - compiler should put the source file name into the class |
|
2444 |
(Symbol hasInterned:aClassName) ifTrue:[:sym | |
|
2379 | 2445 |
|class| |
2446 |
||
2447 |
(Smalltalk includesKey:sym) ifTrue:[ |
|
2448 |
class := Smalltalk at:sym. |
|
2449 |
class isClass ifTrue:[ |
|
2450 |
abbrev := class classFileName. |
|
2451 |
] |
|
2452 |
] |
|
617 | 2453 |
]. |
2454 |
" |
|
2455 |
||
2456 |
"look for abbreviation" |
|
2457 |
||
2458 |
abbrev := self filenameAbbreviations at:fileName ifAbsent:[nil]. |
|
2459 |
abbrev notNil ifTrue:[^ abbrev]. |
|
2460 |
||
2461 |
"no abbreviation found - if its a short name, take it" |
|
2462 |
||
2463 |
OperatingSystem maxFileNameLength < (fileName size + 3) ifTrue:[ |
|
2379 | 2464 |
"this will only be triggered on sys5.3/DOS type systems" |
2465 |
self warn:'cant find short for ' , fileName , ' in abbreviation file' |
|
617 | 2466 |
]. |
2467 |
^ fileName asString |
|
2468 |
||
2469 |
" |
|
2470 |
Smalltalk fileNameForClass:SmallInteger |
|
2471 |
Smalltalk fileNameForClass:'SmallInteger' |
|
2472 |
Smalltalk fileNameForClass:'OperatingSystem' |
|
2473 |
Smalltalk fileNameForClass:'SomeUnknownClass' |
|
2474 |
" |
|
2475 |
||
2476 |
"Modified: 6.11.1995 / 15:37:33 / cg" |
|
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
456
diff
changeset
|
2477 |
! |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
456
diff
changeset
|
2478 |
|
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
2479 |
filenameAbbreviations |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
2480 |
"return a dictionary containing the classname-to-filename |
617 | 2481 |
mappings. (needed for sys5.3 users, where filenames are limited |
2482 |
to 14 chars)" |
|
2483 |
||
2484 |
CachedAbbreviations isNil ifTrue:[ |
|
2379 | 2485 |
self readAbbreviations |
617 | 2486 |
]. |
2487 |
^ CachedAbbreviations |
|
2488 |
||
2489 |
"flush with: |
|
2490 |
||
2491 |
CachedAbbreviations := nil |
|
2492 |
" |
|
2493 |
" |
|
2494 |
Smalltalk filenameAbbreviations |
|
2495 |
" |
|
2496 |
! |
|
2497 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
2498 |
flushPathCaches |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
2499 |
"{ Pragma: +optSpace }" |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
2500 |
|
2378 | 2501 |
"forget pathCaches - these are collections containing valid directory names, |
2502 |
where system files (resource, bitmaps etc.) are found. |
|
2503 |
A flush is only required, if a new system directory has been created while |
|
2504 |
the system is active, and those files should override the others |
|
2505 |
(for example, if you created a private resource directory)" |
|
2506 |
||
617 | 2507 |
RealSystemPath := ResourcePath := SourcePath := BitmapPath := BinaryPath := FileInPath := nil |
2378 | 2508 |
|
2509 |
" |
|
2510 |
Smalltalk flushPathCaches |
|
2511 |
" |
|
617 | 2512 |
! |
2513 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
2514 |
getBinaryFileName:aFileName |
617 | 2515 |
"search aFileName in some standard places |
2516 |
(subdirectories named 'binary' in SystemPath); |
|
2517 |
return the absolute filename or nil if none is found." |
|
2518 |
||
1562
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
2519 |
BinaryPath isNil ifTrue:[ |
2928 | 2520 |
BinaryPath := self constructPathFor:BinaryDirName |
617 | 2521 |
]. |
2522 |
||
2928 | 2523 |
^ self searchPath:BinaryPath for:aFileName in:BinaryDirName |
1562
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
2524 |
|
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
2525 |
"Modified: 18.7.1996 / 15:53:49 / cg" |
453 | 2526 |
! |
2527 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
2528 |
getBitmapFileName:aFileName |
617 | 2529 |
"search aFileName in some standard places |
2530 |
(subdirectories named 'bitmaps' in SystemPath); |
|
2531 |
return the absolute filename or nil if none is found." |
|
2532 |
||
2974 | 2533 |
|f| |
2534 |
||
617 | 2535 |
BitmapPath isNil ifTrue:[ |
2928 | 2536 |
BitmapPath := self constructPathFor:BitmapDirName |
617 | 2537 |
]. |
2538 |
||
2974 | 2539 |
"/ first, try a bitmaps subdir along the path. |
2540 |
f := self searchPath:BitmapPath for:aFileName in:BitmapDirName. |
|
2541 |
f isNil ifTrue:[ |
|
2542 |
"/ then, try it itself along the path. |
|
2543 |
f := self searchPath:RealSystemPath for:aFileName in:nil |
|
2544 |
]. |
|
2545 |
^ f |
|
617 | 2546 |
|
2547 |
" |
|
2548 |
Smalltalk getBitmapFileName:'SBrowser.xbm' |
|
2549 |
" |
|
1562
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
2550 |
|
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
2551 |
"Modified: 18.7.1996 / 15:53:55 / cg" |
617 | 2552 |
! |
2553 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
2554 |
getFileInFileName:aFileName |
617 | 2555 |
"search aFileName in some standard places |
2556 |
(subdirectories named 'fileIn' in SystemPath); |
|
2557 |
return the absolute filename or nil if none is found." |
|
2558 |
||
1562
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
2559 |
FileInPath isNil ifTrue:[ |
2928 | 2560 |
FileInPath := self constructPathFor:FileInDirName |
617 | 2561 |
]. |
2562 |
||
2928 | 2563 |
^ self searchPath:FileInPath for:aFileName in:FileInDirName |
1562
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
2564 |
|
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
2565 |
"Modified: 18.7.1996 / 15:53:59 / cg" |
617 | 2566 |
! |
2567 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
2568 |
getResourceFileName:aFileName |
617 | 2569 |
"search aFileName in some standard places |
2570 |
(subdirectories named 'resource' in SystemPath); |
|
2571 |
return the absolute filename or nil if none is found." |
|
2572 |
||
2974 | 2573 |
|f| |
2574 |
||
617 | 2575 |
ResourcePath isNil ifTrue:[ |
2928 | 2576 |
ResourcePath := self constructPathFor:ResourceDirName |
617 | 2577 |
]. |
2578 |
||
2974 | 2579 |
"/ first, try a resource subdir along the path. |
2580 |
f := self searchPath:ResourcePath for:aFileName in:ResourceDirName. |
|
2581 |
f isNil ifTrue:[ |
|
2582 |
"/ then, try it itself along the path. |
|
2583 |
f := self searchPath:RealSystemPath for:aFileName in:nil |
|
2584 |
]. |
|
2585 |
^ f |
|
617 | 2586 |
|
2587 |
" |
|
2588 |
Smalltalk getResourceFileName:'SBrowser.rs' |
|
2589 |
" |
|
1562
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
2590 |
|
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
2591 |
"Modified: 18.7.1996 / 15:54:03 / cg" |
617 | 2592 |
! |
2593 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
2594 |
getSourceFileName:aFileName |
617 | 2595 |
"search aFileName in some standard places |
2596 |
(subdirectories named 'source' in SystemPath); |
|
736 | 2597 |
return the absolute filename or nil if none is found. |
2598 |
This is used to find a sourceFile for a methods source, |
|
2599 |
if no sourceCodeManager is available." |
|
617 | 2600 |
|
2959 | 2601 |
|f| |
2602 |
||
617 | 2603 |
SourcePath isNil ifTrue:[ |
2928 | 2604 |
SourcePath := self constructPathFor:SourceDirName |
617 | 2605 |
]. |
2606 |
||
2959 | 2607 |
"/ first, try a source subdir along the path. |
2608 |
f := self searchPath:SourcePath for:aFileName in:SourceDirName. |
|
2609 |
f isNil ifTrue:[ |
|
2610 |
"/ then, try it itself along the path. |
|
2974 | 2611 |
f := self searchPath:RealSystemPath for:aFileName in:nil |
2959 | 2612 |
]. |
2613 |
^ f |
|
191 | 2614 |
|
2615 |
" |
|
736 | 2616 |
Smalltalk getSourceFileName:'Smalltalk.st' |
2617 |
Smalltalk getSourceFileName:'ArrColl.st' |
|
191 | 2618 |
" |
1562
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
2619 |
|
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
2620 |
"Modified: 18.7.1996 / 15:54:07 / cg" |
617 | 2621 |
! |
2622 |
||
2896 | 2623 |
getSystemFileName:aFileNameOrString |
2624 |
"search aFileNameOrString in some standard places; |
|
617 | 2625 |
return the absolute filename or nil if none is found. |
2626 |
see comment in Smalltalk>>initSystemPath." |
|
2627 |
||
2628 |
"credits for this method go to Markus ...." |
|
2629 |
||
2933 | 2630 |
|fn nameString| |
2896 | 2631 |
|
2632 |
fn := aFileNameOrString asFilename. |
|
2933 | 2633 |
nameString := fn name. |
2896 | 2634 |
fn isAbsolute ifTrue:[ |
2379 | 2635 |
"dont use path for absolute file names" |
2636 |
||
2933 | 2637 |
^ nameString |
191 | 2638 |
]. |
2639 |
||
617 | 2640 |
self realSystemPath do:[:dirName | |
2379 | 2641 |
|realName| |
2642 |
||
2933 | 2643 |
realName := dirName asFilename construct:nameString. |
2928 | 2644 |
"/ |
2645 |
"/ here, we also return true if its a directory |
|
2646 |
"/ (Even if unreadable). |
|
2647 |
"/ It could be that the file itself is still readable. |
|
2648 |
"/ |
|
2649 |
(realName isDirectory or:[realName isReadable]) ifTrue: [ |
|
2896 | 2650 |
^ realName name |
2379 | 2651 |
] |
191 | 2652 |
]. |
617 | 2653 |
^ nil |
2654 |
! |
|
2655 |
||
2169 | 2656 |
installAutoloadedClasses |
2657 |
"read the standard abbreviation file; install all classes found there as |
|
2658 |
autoloaded. This takes some time ..." |
|
2659 |
||
2660 |
self installAutoloadedClassesFrom:'include/abbrev.stc' |
|
2661 |
||
2662 |
" |
|
2663 |
Smalltalk installAutoloadedClasses |
|
2664 |
" |
|
2665 |
||
2666 |
"Modified: 10.1.1997 / 15:10:48 / cg" |
|
2667 |
"Created: 14.2.1997 / 17:32:57 / cg" |
|
2668 |
! |
|
2669 |
||
1625
0ef643b30394
install autoloaded classes is now a method in Smalltalk
Claus Gittinger <cg@exept.de>
parents:
1620
diff
changeset
|
2670 |
installAutoloadedClassesFrom:anAbbrevFilePath |
2169 | 2671 |
"read the given abbreviation file; install all classes found there as |
1911 | 2672 |
autoloaded. This takes some time ..." |
2673 |
||
1625
0ef643b30394
install autoloaded classes is now a method in Smalltalk
Claus Gittinger <cg@exept.de>
parents:
1620
diff
changeset
|
2674 |
|f s s2 l clsName abbrev package cat rev cls| |
0ef643b30394
install autoloaded classes is now a method in Smalltalk
Claus Gittinger <cg@exept.de>
parents:
1620
diff
changeset
|
2675 |
|
0ef643b30394
install autoloaded classes is now a method in Smalltalk
Claus Gittinger <cg@exept.de>
parents:
1620
diff
changeset
|
2676 |
f := self getSystemFileName:anAbbrevFilePath. |
1911 | 2677 |
|
1625
0ef643b30394
install autoloaded classes is now a method in Smalltalk
Claus Gittinger <cg@exept.de>
parents:
1620
diff
changeset
|
2678 |
f notNil ifTrue:[ |
2123 | 2679 |
s := f asFilename readStream. |
2680 |
s notNil ifTrue:[ |
|
2374 | 2681 |
|
2682 |
"/ yes, create any required nameSpace, without asking user. |
|
2683 |
Class createNameSpaceQuerySignal answer:true do:[ |
|
2684 |
||
2685 |
[s atEnd] whileFalse:[ |
|
2686 |
l := s nextLine withoutSeparators. |
|
2687 |
l notEmpty ifTrue:[ |
|
2688 |
s2 := l readStream. |
|
2689 |
clsName := (s2 upTo:Character space) withoutSeparators asSymbol. |
|
2690 |
(self at:clsName) isNil ifTrue:[ |
|
2691 |
s2 skipSeparators. |
|
2692 |
abbrev := (s2 upTo:Character space) withoutSeparators asSymbol. |
|
2693 |
s2 skipSeparators. |
|
2694 |
package := (s2 upTo:Character space) withoutSeparators asSymbol. |
|
2695 |
s2 skipSeparators. |
|
2696 |
||
2697 |
rev := nil. |
|
2698 |
s2 skipSeparators. |
|
2699 |
s2 atEnd ifFalse:[ |
|
2700 |
s2 peek isDigit ifTrue:[ |
|
2701 |
rev := (s2 upTo:Character space) withoutSeparators. |
|
2702 |
s2 skipSeparators. |
|
2703 |
] |
|
2170 | 2704 |
]. |
2374 | 2705 |
cat := s2 upToEnd withoutSeparators. |
2706 |
||
2707 |
(cat startsWith:$') ifTrue:[ |
|
2708 |
cat := (cat copyFrom:2 to:(cat size - 1)) withoutSeparators. |
|
2709 |
]. |
|
2710 |
||
2711 |
(cat isNil or:[cat isEmpty]) ifTrue:[ |
|
2712 |
cat := 'autoloaded' |
|
2713 |
]. |
|
2714 |
||
2588
090cf1da8036
handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents:
2572
diff
changeset
|
2715 |
"/ ' autoloaded: ' print. clsName print. ' in ' print. cat printCR. |
2374 | 2716 |
|
2717 |
"/ install if not already compiled-in |
|
2718 |
Autoload subclass:clsName |
|
2719 |
instanceVariableNames:'' |
|
2720 |
classVariableNames:'' |
|
2721 |
poolDictionaries:'' |
|
2722 |
category:cat |
|
2723 |
inEnvironment:Smalltalk. |
|
2724 |
||
2725 |
cls := self at:clsName. |
|
2726 |
cls isNil ifTrue:[ |
|
2727 |
('Smalltalk [warning]: failed to add ' , clsName , ' as autoloaded.') infoPrintCR. |
|
2728 |
] ifFalse:[ |
|
2729 |
cls package:package asSymbol. |
|
2730 |
rev notNil ifTrue:[ |
|
2731 |
cls setBinaryRevision:rev |
|
2732 |
] |
|
2733 |
] |
|
2734 |
] |
|
2123 | 2735 |
] |
2736 |
] |
|
2737 |
]. |
|
2738 |
s close. |
|
2739 |
]. |
|
1625
0ef643b30394
install autoloaded classes is now a method in Smalltalk
Claus Gittinger <cg@exept.de>
parents:
1620
diff
changeset
|
2740 |
] |
0ef643b30394
install autoloaded classes is now a method in Smalltalk
Claus Gittinger <cg@exept.de>
parents:
1620
diff
changeset
|
2741 |
|
0ef643b30394
install autoloaded classes is now a method in Smalltalk
Claus Gittinger <cg@exept.de>
parents:
1620
diff
changeset
|
2742 |
" |
0ef643b30394
install autoloaded classes is now a method in Smalltalk
Claus Gittinger <cg@exept.de>
parents:
1620
diff
changeset
|
2743 |
Smalltalk installAutoloadedClassesFrom:'include/abbrev.stc' |
0ef643b30394
install autoloaded classes is now a method in Smalltalk
Claus Gittinger <cg@exept.de>
parents:
1620
diff
changeset
|
2744 |
" |
0ef643b30394
install autoloaded classes is now a method in Smalltalk
Claus Gittinger <cg@exept.de>
parents:
1620
diff
changeset
|
2745 |
|
2374 | 2746 |
"Modified: 10.2.1997 / 12:22:44 / cg" |
1625
0ef643b30394
install autoloaded classes is now a method in Smalltalk
Claus Gittinger <cg@exept.de>
parents:
1620
diff
changeset
|
2747 |
! |
0ef643b30394
install autoloaded classes is now a method in Smalltalk
Claus Gittinger <cg@exept.de>
parents:
1620
diff
changeset
|
2748 |
|
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
2749 |
libraryFileNameOfClass:aClassOrClassName |
617 | 2750 |
"for a given class, return the name of a classLibrary which contains |
2751 |
binary code for it. |
|
2752 |
Read the libinfo file 'liblist.stc' (which is created during the compilation process) |
|
2753 |
for an entry for aClassOrClassName. |
|
2754 |
Search for the className in the first col, and return the value found in |
|
2755 |
the 2nd col. |
|
2756 |
Return nil if no entry is found. |
|
2757 |
||
2758 |
A nil returns means that this class is either built-in or not present |
|
2759 |
in a package-class library (i.e. either as separate .o or separate .st file). |
|
2760 |
Otherwise, the returned name is the classLibrary object of that class. |
|
2761 |
The classes code can be loaded from that file if binary loading is supported." |
|
2762 |
||
2763 |
|aStream line words n aClassName| |
|
2764 |
||
2765 |
aClassOrClassName isBehavior ifTrue:[ |
|
2379 | 2766 |
aClassName := aClassOrClassName name |
617 | 2767 |
] ifFalse:[ |
2379 | 2768 |
aClassName := aClassOrClassName |
617 | 2769 |
]. |
2770 |
aClassName := aClassName asString. |
|
2771 |
||
2772 |
#('include/liblist.stc') "/ filenames |
|
2773 |
with:#(2) "/ column |
|
2774 |
do:[:fileName :col | |
|
2775 |
||
2379 | 2776 |
aStream := self systemFileStreamFor:fileName. |
2777 |
aStream notNil ifTrue:[ |
|
2778 |
[aStream atEnd] whileFalse:[ |
|
2779 |
line := aStream nextLine. |
|
2780 |
line notNil ifTrue:[ |
|
2781 |
(line startsWith:'#') ifFalse:[ |
|
2782 |
words := line asCollectionOfWords. |
|
2783 |
(n := words size) > 1 ifTrue:[ |
|
2784 |
(words at:1) = aClassName ifTrue:[ |
|
2785 |
n >= col ifTrue:[ |
|
2786 |
aStream close. |
|
2787 |
^ (words at:col) withoutSeparators |
|
2788 |
] |
|
2789 |
] |
|
2790 |
] |
|
2791 |
] |
|
2792 |
] |
|
2793 |
]. |
|
2794 |
aStream close |
|
2795 |
]. |
|
617 | 2796 |
]. |
2797 |
||
2798 |
^ nil |
|
2799 |
||
2800 |
" |
|
2801 |
Smalltalk libraryFileNameOfClass:'ClockView' |
|
2802 |
Smalltalk libraryFileNameOfClass:'Bag' |
|
2803 |
" |
|
2804 |
||
2805 |
"Modified: 6.11.1995 / 15:41:39 / cg" |
|
2806 |
! |
|
2807 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
2808 |
loadBinaries |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
2809 |
"return true, if binaries should be loaded into the system, |
617 | 2810 |
false if this should be suppressed. The default is false (for now)." |
2811 |
||
2812 |
^ LoadBinaries |
|
2813 |
! |
|
2814 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
2815 |
loadBinaries:aBoolean |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
2816 |
"{ Pragma: +optSpace }" |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
2817 |
|
617 | 2818 |
"turn on/off loading of binary objects" |
2819 |
||
935
4317f75fa478
dont allow setting the loadBinaries flag, if there is no ObjectFileLoader
Claus Gittinger <cg@exept.de>
parents:
908
diff
changeset
|
2820 |
aBoolean ifTrue:[ |
2123 | 2821 |
(ObjectFileLoader notNil and:[ObjectFileLoader canLoadObjectFiles]) ifTrue:[ |
2822 |
LoadBinaries := true. |
|
2823 |
^ self |
|
2824 |
]. |
|
2825 |
'Smalltalk [info]: this system does not support binary loading' infoPrintCR. |
|
935
4317f75fa478
dont allow setting the loadBinaries flag, if there is no ObjectFileLoader
Claus Gittinger <cg@exept.de>
parents:
908
diff
changeset
|
2826 |
]. |
4317f75fa478
dont allow setting the loadBinaries flag, if there is no ObjectFileLoader
Claus Gittinger <cg@exept.de>
parents:
908
diff
changeset
|
2827 |
LoadBinaries := false |
2123 | 2828 |
|
2829 |
"Modified: 10.1.1997 / 15:11:00 / cg" |
|
617 | 2830 |
! |
2831 |
||
1850 | 2832 |
loadClassLibraryIfAbsent:name |
2833 |
"dynamically load a classLibrary, if not already loaded |
|
2834 |
and the system supports dynamic loading. |
|
1956 | 2835 |
Return true, if the library is loaded, false if not. |
2836 |
This entry is called without system specific filename |
|
2837 |
extensions - it is portable among different architectures |
|
2838 |
as long as corresponding files (x.so / x.dll / x.sl / x.o) |
|
2839 |
are be present ..." |
|
1850 | 2840 |
|
2841 |
ObjectMemory |
|
2379 | 2842 |
binaryModuleInfo |
2843 |
do:[:entry | |
|
2844 |
entry type == #classLibrary ifTrue:[ |
|
2845 |
entry libraryName = name ifTrue:[ |
|
2846 |
^ true "/ already loaded |
|
2847 |
] |
|
2848 |
]. |
|
2849 |
]. |
|
1850 | 2850 |
|
2851 |
^ self fileInClassLibrary:name |
|
2852 |
||
2853 |
" |
|
2854 |
Smalltalk loadClassLibraryIfAbsent:'libbasic' |
|
2855 |
Smalltalk loadClassLibraryIfAbsent:'libwidg3' |
|
2856 |
" |
|
2857 |
||
2858 |
"Modified: 31.10.1996 / 16:57:24 / cg" |
|
2859 |
! |
|
2860 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
2861 |
logDoits |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
2862 |
"return true if doits should go into the changes file |
617 | 2863 |
as well as changes - by default, this is off, since |
2864 |
it can blow up the changes file enormously ... |
|
2865 |
" |
|
2866 |
||
2867 |
^ LogDoits |
|
2868 |
||
2869 |
" |
|
2870 |
LogDoits := false |
|
2871 |
LogDoits := true |
|
2872 |
" |
|
2873 |
! |
|
2874 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
2875 |
logDoits:aBoolean |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
2876 |
"{ Pragma: +optSpace }" |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
2877 |
|
617 | 2878 |
"turn on/off logging of doits in the changes file. |
2879 |
By default, this is off, since it can blow up the |
|
2880 |
changes file enormously ... |
|
2881 |
" |
|
2882 |
||
2883 |
LogDoits := aBoolean |
|
2884 |
||
2885 |
! |
|
2886 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
2887 |
readAbbreviations |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
2888 |
"read classname to filename mappings from include/abbrev.stc. |
617 | 2889 |
sigh - all for those poor sys5.3 or MSDOS people with short filenames ..." |
2890 |
||
1131
c12018d50e2d
more checks for abbreviation conflicts
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
2891 |
|abbrevs aStream line words nm abbrev key oldAbbrev cls| |
617 | 2892 |
|
2893 |
CachedAbbreviations := abbrevs := IdentityDictionary new. |
|
2894 |
aStream := self systemFileStreamFor:'include/abbrev.stc'. |
|
2895 |
aStream notNil ifTrue:[ |
|
2123 | 2896 |
[aStream atEnd] whileFalse:[ |
2897 |
line := aStream nextLine. |
|
2898 |
line notNil ifTrue:[ |
|
2899 |
(line startsWith:'#') ifFalse:[ |
|
2900 |
words := line asCollectionOfWords. |
|
2901 |
words size >= 2 ifTrue:[ |
|
2902 |
nm := (words at:1) withoutSeparators. |
|
2903 |
abbrev := (words at:2) withoutSeparators. |
|
2904 |
nm ~= abbrev ifTrue:[ |
|
2905 |
key := nm asSymbol. |
|
2906 |
oldAbbrev := abbrevs at:key ifAbsent:nil. |
|
2907 |
oldAbbrev notNil ifTrue:[ |
|
2908 |
oldAbbrev ~= abbrev ifTrue:[ |
|
2909 |
StandAlone ifFalse:[ |
|
2910 |
('Smalltalk [warning]: conflict for: ' , nm , ' in abbrev.stc (' , oldAbbrev , ' <-> ' , abbrev , ')') infoPrintCR |
|
2911 |
] |
|
2912 |
]. |
|
2913 |
] ifFalse:[ |
|
2914 |
cls := self classNamed:abbrev. |
|
2915 |
||
2916 |
cls notNil ifTrue:[ |
|
2917 |
cls name ~= nm ifTrue:[ |
|
2918 |
"/ ok, there is a class named after this abbrev ... |
|
2919 |
"/ this is only a conflict, if the other class has no |
|
2920 |
"/ abbreviation (or the same). |
|
2921 |
(abbrevs at:(cls name asSymbol) ifAbsent:cls name) = abbrev ifTrue:[ |
|
2922 |
cls isNamespace ifFalse:[ |
|
2923 |
StandAlone ifFalse:[ |
|
2924 |
('Smalltalk [warning]: conflict for: ' , cls name , ' in abbrev.stc (' , nm , ' -> ' , abbrev , ')') infoPrintCR |
|
2925 |
] |
|
2926 |
] |
|
2927 |
] |
|
2928 |
] |
|
2929 |
]. |
|
2930 |
abbrevs at:nm asSymbol put:abbrev. |
|
2931 |
] |
|
2932 |
] |
|
2933 |
] |
|
2934 |
] |
|
2935 |
] |
|
2936 |
]. |
|
2937 |
aStream close |
|
617 | 2938 |
]. |
2939 |
^ abbrevs |
|
191 | 2940 |
|
2941 |
" |
|
617 | 2942 |
Smalltalk readAbbreviations |
191 | 2943 |
" |
617 | 2944 |
|
2123 | 2945 |
"Modified: 10.1.1997 / 15:11:28 / cg" |
617 | 2946 |
! |
2947 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
2948 |
realSystemPath |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
2949 |
"return the realSystemPath - thats the directorynames from |
617 | 2950 |
SystemPath which exist and are readable" |
2951 |
||
2952 |
RealSystemPath isNil ifTrue:[ |
|
2928 | 2953 |
OperatingSystem isVMSlike ifTrue:[ |
2954 |
"/ temporary kludge: since we cannot currently |
|
2955 |
"/ check for existance of a name like 'volume:', |
|
2956 |
"/ leave those in the Path without a check. |
|
2957 |
RealSystemPath := SystemPath select:[:dirName | |
|
2958 |
|f| |
|
2959 |
||
2960 |
f := dirName asFilename. |
|
2961 |
f isVolumeOnly ifTrue:[ |
|
2962 |
true |
|
2963 |
] ifFalse:[ |
|
2964 |
(f isDirectory) and:[f isReadable] |
|
2965 |
] |
|
2966 |
] |
|
2967 |
] ifFalse:[ |
|
2968 |
RealSystemPath := SystemPath select:[:dirName | |
|
2969 |
|f| |
|
2970 |
||
2971 |
f := dirName asFilename. |
|
2972 |
(f isDirectory) and:[f isReadable] |
|
2973 |
] |
|
2379 | 2974 |
]. |
617 | 2975 |
]. |
2976 |
^ RealSystemPath |
|
2977 |
! |
|
2978 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
2979 |
resourceFileStreamFor:aFileName |
617 | 2980 |
"search aFileName in some standard places; |
2981 |
return a readonly fileStream or nil if not found. |
|
2982 |
Searches in subdirectories named 'resource' in SystemPath" |
|
2983 |
||
2984 |
|aString| |
|
2985 |
||
2986 |
aString := self getResourceFileName:aFileName. |
|
2987 |
aString notNil ifTrue:[ |
|
2928 | 2988 |
^ aString asFilename readStream |
617 | 2989 |
]. |
2990 |
^ nil |
|
2991 |
! |
|
2992 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
2993 |
searchPath:aPath for:aFileName in:aDirName |
617 | 2994 |
"search aPath for a subdirectory named aDirectory with a file |
2995 |
named aFileName" |
|
2996 |
||
2928 | 2997 |
|f| |
2998 |
||
2999 |
((f := aFileName asFilename) isAbsolute |
|
3000 |
or:[f isExplicitRelative]) ifTrue:[ |
|
2379 | 3001 |
"/ |
3002 |
"/ dont use path for absolute or explicit .-relative file names |
|
3003 |
"/ |
|
3004 |
^ aFileName |
|
1562
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
3005 |
]. |
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
3006 |
|
617 | 3007 |
aPath do:[:dirName | |
2379 | 3008 |
|realName| |
3009 |
||
2959 | 3010 |
aDirName notNil ifTrue:[ |
3011 |
realName := (dirName asFilename construct:aDirName) constructString:aFileName. |
|
3012 |
] ifFalse:[ |
|
3013 |
realName := dirName asFilename constructString:aFileName. |
|
3014 |
]. |
|
2928 | 3015 |
realName asFilename isReadable ifTrue:[ |
2379 | 3016 |
^ realName |
3017 |
] |
|
617 | 3018 |
]. |
3019 |
^ nil |
|
1562
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
3020 |
|
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
3021 |
"Modified: 18.7.1996 / 15:53:35 / cg" |
617 | 3022 |
! |
3023 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3024 |
secureFileIn:aFileName |
617 | 3025 |
"read in the named file, looking for it at standard places. |
3026 |
Catch any error during fileIn. Return true if ok, false if failed" |
|
3027 |
||
1114 | 3028 |
|retVal| |
3029 |
||
3030 |
retVal := false. |
|
3031 |
||
3032 |
(SignalSet with:AbortSignal with:Process terminateSignal) |
|
2379 | 3033 |
handle:[:ex | |
3034 |
ex return |
|
3035 |
] do:[ |
|
3036 |
retVal := self fileIn:aFileName |
|
3037 |
]. |
|
1114 | 3038 |
^ retVal |
617 | 3039 |
! |
3040 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3041 |
silentFileIn:aFilename |
617 | 3042 |
"same as fileIn:, but do not output 'compiled...'-messages on Transcript. |
3043 |
Main use is during startup." |
|
3044 |
||
3045 |
|wasSilent| |
|
3046 |
||
3047 |
wasSilent := self silentLoading:true. |
|
3048 |
[ |
|
2379 | 3049 |
self fileIn:aFilename |
617 | 3050 |
] valueNowOrOnUnwindDo:[ |
2379 | 3051 |
self silentLoading:wasSilent |
617 | 3052 |
] |
3053 |
! |
|
3054 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3055 |
sourceDirectoryNameOfClass:aClassOrClassName |
617 | 3056 |
"for a given class, return the pathname relative to TOP of the classes source code. |
728
50cf1c907c28
again search liblist for a classes source directory
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3057 |
Read the files 'abbrev.stc' and 'liblist.stc' (which are created during the compilation process) |
617 | 3058 |
for an entry for aClassOrClassName. |
3059 |
Search for the className in the first col, and return the value found in |
|
3060 |
the 3rd col. |
|
3061 |
Return nil if no entry is found." |
|
3062 |
||
3063 |
|aStream line words n aClassName| |
|
3064 |
||
3065 |
aClassOrClassName isBehavior ifTrue:[ |
|
2379 | 3066 |
aClassName := aClassOrClassName name |
617 | 3067 |
] ifFalse:[ |
2379 | 3068 |
aClassName := aClassOrClassName |
191 | 3069 |
]. |
617 | 3070 |
aClassName := aClassName asString. |
3071 |
||
728
50cf1c907c28
again search liblist for a classes source directory
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3072 |
#('include/abbrev.stc' 'include/liblist.stc') "/ filenames |
50cf1c907c28
again search liblist for a classes source directory
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3073 |
with:#(3 2) "/ column |
617 | 3074 |
do:[:fileName :col | |
3075 |
||
2379 | 3076 |
aStream := self systemFileStreamFor:fileName. |
3077 |
aStream notNil ifTrue:[ |
|
3078 |
[aStream atEnd] whileFalse:[ |
|
3079 |
line := aStream nextLine. |
|
3080 |
line notNil ifTrue:[ |
|
3081 |
(line startsWith:'#') ifFalse:[ |
|
3082 |
words := line asCollectionOfWords. |
|
3083 |
(n := words size) > 1 ifTrue:[ |
|
3084 |
(words at:1) = aClassName ifTrue:[ |
|
3085 |
n >= col ifTrue:[ |
|
3086 |
aStream close. |
|
3087 |
^ (words at:col) withoutSeparators |
|
3088 |
] |
|
3089 |
] |
|
3090 |
] |
|
3091 |
] |
|
3092 |
] |
|
3093 |
]. |
|
3094 |
aStream close |
|
3095 |
]. |
|
617 | 3096 |
]. |
3097 |
||
3098 |
^ nil |
|
191 | 3099 |
|
3100 |
" |
|
617 | 3101 |
Smalltalk sourceDirectoryNameOfClass:'ClockView' |
3102 |
Smalltalk sourceDirectoryNameOfClass:'Bag' |
|
3103 |
Smalltalk sourceDirectoryNameOfClass:'GLWireCubeDemoView' |
|
3104 |
Smalltalk sourceDirectoryNameOfClass:'SomeNonExistingClass' |
|
3105 |
" |
|
3106 |
||
3107 |
"Created: 6.11.1995 / 15:43:30 / cg" |
|
728
50cf1c907c28
again search liblist for a classes source directory
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3108 |
"Modified: 9.12.1995 / 23:54:14 / cg" |
2033 | 3109 |
"Modified: 3.1.1997 / 11:26:44 / stefan" |
617 | 3110 |
! |
3111 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3112 |
sourceFileStreamFor:aFileName |
617 | 3113 |
"search aFileName in some standard places; |
3114 |
return a readonly fileStream or nil if not found. |
|
3115 |
Searches in subdirectories named 'source' in SystemPath" |
|
3116 |
||
3117 |
|aString| |
|
3118 |
||
3119 |
aString := self getSourceFileName:aFileName. |
|
3120 |
aString notNil ifTrue:[ |
|
2928 | 3121 |
^ aString asFilename readStream |
617 | 3122 |
]. |
3123 |
^ nil |
|
3124 |
! |
|
3125 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3126 |
systemFileStreamFor:aFileName |
617 | 3127 |
"search aFileName in some standard places; |
3128 |
return a readonly fileStream or nil if not found. |
|
3129 |
see comment in Smalltalk>>initSystemPath" |
|
3130 |
||
3131 |
|aString| |
|
3132 |
||
3133 |
aString := self getSystemFileName:aFileName. |
|
3134 |
aString notNil ifTrue:[ |
|
2928 | 3135 |
^ aString asFilename readStream |
617 | 3136 |
]. |
3137 |
^ nil |
|
3138 |
! |
|
3139 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3140 |
systemPath |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3141 |
"return a collection of directorynames, where smalltalk |
617 | 3142 |
looks for system files |
3143 |
(usually in subdirs such as resources, bitmaps, source etc.) |
|
3144 |
see comment in Smalltalk>>initSystemPath." |
|
3145 |
||
3146 |
^ SystemPath |
|
3147 |
||
3148 |
" |
|
3149 |
Smalltalk systemPath |
|
3150 |
Smalltalk systemPath addLast:'someOtherDirectoryPath' |
|
3151 |
" |
|
3152 |
! |
|
3153 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3154 |
systemPath:aPath |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3155 |
"set the collection of directorynames, where smalltalk |
617 | 3156 |
looks for system files |
3157 |
(usually in subdirs such as resources, bitmaps, source etc.) |
|
3158 |
see comment in Smalltalk>>initSystemPath." |
|
3159 |
||
3160 |
SystemPath := aPath. |
|
3161 |
self flushPathCaches |
|
3162 |
||
3163 |
" |
|
3164 |
Smalltalk systemPath |
|
3165 |
Smalltalk systemPath:(Smalltalk systemPath copy addLast:'someOtherDirectoryPath') |
|
191 | 3166 |
" |
1 | 3167 |
! ! |
2 | 3168 |
|
2159 | 3169 |
!Smalltalk class methodsFor:'system management-fileIn'! |
3170 |
||
3171 |
fileIn:aFileName |
|
3172 |
"read in the named file - look for it in some standard places; |
|
3173 |
return true if ok, false if failed" |
|
3174 |
||
3175 |
^ self fileIn:aFileName lazy:nil silent:nil logged:false |
|
3176 |
||
3177 |
" |
|
3178 |
Smalltalk fileIn:'source/TicTacToe.st' |
|
3179 |
" |
|
3180 |
||
3181 |
"Created: 28.10.1995 / 17:06:28 / cg" |
|
3182 |
! |
|
3183 |
||
3184 |
fileIn:aFileName lazy:lazy |
|
3185 |
"read in the named file - look for it in some standard places; |
|
3186 |
return true if ok, false if failed. |
|
3187 |
If lazy is true, no code is generated for methods, instead stubs |
|
3188 |
are created which compile themself when first executed. This allows |
|
3189 |
for much faster fileIn (but slows down the first execution later). |
|
3190 |
Since no syntax checks are done when doing lazy fileIn, use this only for |
|
3191 |
code which is known to be syntactically correct." |
|
3192 |
||
3193 |
^ self fileIn:aFileName lazy:lazy silent:nil logged:false |
|
3194 |
||
3195 |
" |
|
3196 |
Smalltalk fileIn:'source/TicTacToe.st' lazy:true |
|
3197 |
" |
|
3198 |
||
3199 |
"Created: 28.10.1995 / 17:06:36 / cg" |
|
3200 |
! |
|
3201 |
||
3202 |
fileIn:aFileName lazy:lazy silent:silent |
|
3203 |
"read in the named file - look for it in some standard places; |
|
3204 |
return true if ok, false if failed. |
|
3205 |
If lazy is true, no code is generated for methods, instead stubs |
|
3206 |
are created which compile themself when first executed. This allows |
|
3207 |
for much faster fileIn (but slows down the first execution later). |
|
3208 |
Since no syntax checks are done when doing lazy fileIn, use this only for |
|
3209 |
code which is known to be syntactically correct. |
|
3210 |
If silent is true, no compiler messages are output to the transcript. |
|
3211 |
Giving nil for silent/lazy will use the current settings." |
|
3212 |
||
3213 |
^ self fileIn:aFileName lazy:lazy silent:silent logged:false |
|
3214 |
||
3215 |
"Created: 28.10.1995 / 17:06:41 / cg" |
|
3216 |
! |
|
3217 |
||
2959 | 3218 |
fileIn:aFileNameOrString lazy:lazy silent:silent logged:logged |
2159 | 3219 |
"read in the named file - look for it in some standard places; |
3220 |
return true if ok, false if failed. |
|
3221 |
If lazy is true, no code is generated for methods, instead stubs |
|
3222 |
are created which compile themself when first executed. This allows |
|
3223 |
for much faster fileIn (but slows down the first execution later). |
|
3224 |
Since no syntax checks are done when doing lazy fileIn, use this only for |
|
3225 |
code which is known to be syntactically correct. |
|
3226 |
If silent is true, no compiler messages are output to the transcript. |
|
3227 |
Giving nil for silent/lazy will use the current settings." |
|
3228 |
||
2959 | 3229 |
|fileNameString aStream path morePath bos| |
3230 |
||
3231 |
fileNameString := aFileNameOrString asString. |
|
2159 | 3232 |
|
3233 |
" |
|
3234 |
an object or shared object ? |
|
3235 |
" |
|
3236 |
(ObjectFileLoader notNil |
|
2959 | 3237 |
and:[ObjectFileLoader hasValidBinaryExtension:fileNameString]) ifTrue:[ |
2159 | 3238 |
LoadBinaries ifFalse:[^ false]. |
2959 | 3239 |
path := self getBinaryFileName:fileNameString. |
2159 | 3240 |
path isNil ifTrue:[^ false]. |
2959 | 3241 |
^ (ObjectFileLoader loadObjectFile:fileNameString) notNil |
2159 | 3242 |
]. |
3243 |
||
2959 | 3244 |
(fileNameString asFilename hasSuffix:'cls') ifTrue:[ |
2159 | 3245 |
BinaryObjectStorage notNil ifTrue:[ |
2959 | 3246 |
path := self getBinaryFileName:fileNameString. |
2159 | 3247 |
path isNil ifTrue:[^ false]. |
3248 |
aStream := path asFilename readStream. |
|
3249 |
aStream notNil ifTrue:[ |
|
3250 |
bos := BinaryObjectStorage onOld:aStream. |
|
3251 |
bos next. |
|
3252 |
bos close. |
|
3253 |
^ true |
|
3254 |
]. |
|
3255 |
^ false |
|
3256 |
] |
|
3257 |
]. |
|
3258 |
||
2959 | 3259 |
(fileNameString startsWith:'source/') ifTrue:[ |
3260 |
aStream := self sourceFileStreamFor:(fileNameString copyFrom:8) |
|
2159 | 3261 |
] ifFalse:[ |
2959 | 3262 |
(fileNameString startsWith:'fileIn/') ifTrue:[ |
3263 |
aStream := self fileInFileStreamFor:(fileNameString copyFrom:8) |
|
2159 | 3264 |
] ifFalse:[ |
2959 | 3265 |
aStream := self systemFileStreamFor:fileNameString. |
3266 |
(aStream notNil and:[fileNameString includes:$/]) ifTrue:[ |
|
2159 | 3267 |
"/ temporarily prepend the files directory |
3268 |
"/ to the searchPath. |
|
3269 |
"/ This allows fileIn-driver files to refer to local |
|
3270 |
"/ files via a relative path, and drivers to fileIn other |
|
3271 |
"/ drivers ... |
|
3272 |
morePath := aStream pathName asFilename directoryName. |
|
3273 |
] |
|
3274 |
] |
|
3275 |
]. |
|
3276 |
aStream isNil ifTrue:[^ false]. |
|
3277 |
^ self fileInStream:aStream lazy:lazy silent:silent logged:logged addPath:morePath |
|
3278 |
||
3279 |
" |
|
3280 |
Smalltalk fileIn:'source/TicTacToe.st' lazy:true silent:true |
|
3281 |
" |
|
3282 |
||
3283 |
"Modified: 8.1.1997 / 17:58:31 / cg" |
|
3284 |
! |
|
3285 |
||
3286 |
fileIn:aFileName logged:logged |
|
3287 |
"read in the named file - look for it in some standard places; |
|
3288 |
return true if ok, false if failed. |
|
3289 |
The argument logged controls, if the changefile is to be updated." |
|
3290 |
||
3291 |
^ self fileIn:aFileName lazy:nil silent:nil logged:logged |
|
3292 |
||
3293 |
" |
|
3294 |
Smalltalk fileIn:'source/TicTacToe.st' logged:false |
|
3295 |
" |
|
3296 |
! |
|
3297 |
||
3298 |
fileInClass:aClassName |
|
3299 |
"find a source/object file for aClassName and -if found - load it. |
|
3300 |
search is in some standard places trying driver-file (.ld), object-file (.o) and |
|
3301 |
finally source file (.st) in that order. |
|
3302 |
The file is first searched for using the class name, then the abbreviated name." |
|
3303 |
||
3304 |
^ self fileInClass:aClassName initialize:true lazy:false silent:nil |
|
3305 |
! |
|
3306 |
||
3307 |
fileInClass:aClassName fromObject:aFileName |
|
3308 |
"read in the named object file and dynamic-link it into the system |
|
3309 |
- look for it in some standard places. |
|
3310 |
Only install the named class from this object file. |
|
3311 |
Return true if ok, false if failed." |
|
3312 |
||
3313 |
|path ok| |
|
3314 |
||
3315 |
" |
|
3316 |
check if the dynamic loader class is in |
|
3317 |
" |
|
3318 |
(LoadBinaries not or:[ObjectFileLoader isNil]) ifTrue:[^ false]. |
|
3319 |
||
3320 |
(path := self getBinaryFileName:aFileName) isNil ifTrue:[^ false]. |
|
3321 |
ok := (ObjectFileLoader loadClass:aClassName fromObjectFile:path) notNil. |
|
3322 |
ok ifTrue:[ |
|
2379 | 3323 |
SilentLoading ifFalse:[ |
3324 |
Transcript show:' loaded ' , aClassName , ' from ' ; showCR:aFileName. |
|
3325 |
] |
|
2159 | 3326 |
]. |
3327 |
^ ok |
|
3328 |
||
3329 |
" |
|
3330 |
Smalltalk fileInClass:'AbstractPath' fromObject:'../../goodies/Paths/AbstrPath.so' |
|
3331 |
Smalltalk fileInClass:'ClockView' fromObject:'../../libwidg3/libwidg3.so' |
|
3332 |
" |
|
3333 |
||
3334 |
"Modified: 10.9.1996 / 20:43:52 / cg" |
|
3335 |
! |
|
3336 |
||
3337 |
fileInClass:aClassName initialize:doInit |
|
3338 |
"find a source/object file for aClassName and -if found - load it. |
|
3339 |
search is in some standard places trying driver-file (.ld), object-file (.o) and |
|
3340 |
finally source file (.st) in that order. |
|
3341 |
The file is first searched for using the class name, then the abbreviated name." |
|
3342 |
||
3343 |
^ self fileInClass:aClassName initialize:doInit lazy:false silent:nil |
|
3344 |
! |
|
3345 |
||
3346 |
fileInClass:aClassName initialize:doInit lazy:loadLazy |
|
3347 |
"find a source/object file for aClassName and -if found - load it. |
|
3348 |
search is in some standard places trying driver-file (.ld), object-file (.o) and |
|
3349 |
finally source file (.st) in that order. |
|
3350 |
The file is first searched for using the class name, then the abbreviated name." |
|
3351 |
||
3352 |
^ self fileInClass:aClassName initialize:doInit lazy:loadLazy silent:nil |
|
3353 |
! |
|
3354 |
||
3355 |
fileInClass:aClassName initialize:doInit lazy:loadLazy silent:beSilent |
|
3356 |
"find a source/object file for aClassName and -if found - load it. |
|
3357 |
This is the workhorse for autoloading. |
|
3358 |
Search is in some standard places, trying driver-file (.ld), object-file (.so / .o) and |
|
3359 |
finally source file (.st), in that order. |
|
3360 |
The file is first searched for using the class name, then the abbreviated name. |
|
3361 |
The argument doInit controlls if the class should be sent a #initialize after the |
|
3362 |
load; loadLazy tells if it should be loaded lazyly. beSilent tells if the compiler |
|
3363 |
should not send notes to the transcript; it can be true, false or nil, where |
|
3364 |
nil uses the value from SilentLoading." |
|
3365 |
||
3366 |
|shortName libName newClass ok wasLazy wasSilent sharedLibExtension inStream mgr fn| |
|
3367 |
||
3368 |
wasLazy := Compiler compileLazy:loadLazy. |
|
3369 |
beSilent notNil ifTrue:[ |
|
2379 | 3370 |
wasSilent := self silentLoading:beSilent. |
2159 | 3371 |
]. |
3372 |
||
3373 |
[ |
|
2379 | 3374 |
Class withoutUpdatingChangesDo: |
3375 |
[ |
|
3376 |
ok := false. |
|
3377 |
||
3378 |
shortName := self fileNameForClass:aClassName. |
|
3379 |
" |
|
3380 |
first, look for a loader-driver file (in fileIn/xxx.ld) |
|
3381 |
" |
|
3382 |
(ok := self fileIn:('fileIn/' , shortName , '.ld') lazy:loadLazy silent:beSilent) |
|
3383 |
ifFalse:[ |
|
3384 |
" |
|
3385 |
try abbreviated driver-file (in fileIn/xxx.ld) |
|
3386 |
" |
|
3387 |
shortName ~= aClassName ifTrue:[ |
|
3388 |
ok := self fileIn:('fileIn/' , aClassName , '.ld') lazy:loadLazy silent:beSilent |
|
3389 |
]. |
|
3390 |
ok ifFalse:[ |
|
3391 |
" |
|
3392 |
then, if dynamic linking is available, |
|
3393 |
" |
|
3394 |
(LoadBinaries and:[ObjectFileLoader notNil]) ifTrue:[ |
|
3395 |
sharedLibExtension := ObjectFileLoader sharedLibraryExtension. |
|
3396 |
||
3397 |
" |
|
3398 |
first look for a class packages shared binary in binary/xxx.o |
|
3399 |
" |
|
3400 |
libName := self libraryFileNameOfClass:aClassName. |
|
3401 |
libName notNil ifTrue:[ |
|
3402 |
(ok := self fileInClass:aClassName fromObject:(libName, sharedLibExtension)) |
|
3403 |
ifFalse:[ |
|
3404 |
sharedLibExtension ~= '.o' ifTrue:[ |
|
3405 |
ok := self fileInClass:aClassName fromObject:(libName, '.o') |
|
3406 |
] |
|
3407 |
]. |
|
3408 |
]. |
|
3409 |
||
3410 |
" |
|
3411 |
then, look for a shared binary in binary/xxx.o |
|
3412 |
" |
|
3413 |
ok ifFalse:[ |
|
3414 |
(ok := self fileInClass:aClassName fromObject:(shortName, sharedLibExtension)) |
|
3415 |
ifFalse:[ |
|
3416 |
sharedLibExtension ~= '.o' ifTrue:[ |
|
3417 |
ok := self fileInClass:aClassName fromObject:(shortName, '.o') |
|
3418 |
]. |
|
3419 |
ok ifFalse:[ |
|
3420 |
shortName ~= aClassName ifTrue:[ |
|
3421 |
(ok := self fileInClass:aClassName fromObject:(aClassName, sharedLibExtension)) |
|
3422 |
ifFalse:[ |
|
3423 |
sharedLibExtension ~= '.o' ifTrue:[ |
|
3424 |
ok := self fileInClass:aClassName fromObject:(aClassName, '.o') |
|
3425 |
] |
|
3426 |
] |
|
3427 |
]. |
|
3428 |
]. |
|
3429 |
]. |
|
3430 |
]. |
|
3431 |
]. |
|
3432 |
||
3433 |
" |
|
3434 |
if that did not work, look for a compiled-bytecode file ... |
|
3435 |
" |
|
3436 |
ok ifFalse:[ |
|
3437 |
(ok := self fileIn:(shortName , '.cls') lazy:loadLazy silent:beSilent) |
|
3438 |
ifFalse:[ |
|
3439 |
shortName ~= aClassName ifTrue:[ |
|
3440 |
ok := self fileIn:(aClassName , '.cls') lazy:loadLazy silent:beSilent |
|
3441 |
] |
|
3442 |
] |
|
3443 |
]. |
|
3444 |
||
3445 |
" |
|
3446 |
if that did not work, look for an st-source file ... |
|
3447 |
" |
|
3448 |
ok ifFalse:[ |
|
3449 |
fn := shortName , '.st'. |
|
3450 |
(ok := self fileIn:fn lazy:loadLazy silent:beSilent) |
|
3451 |
ifFalse:[ |
|
3452 |
shortName ~= aClassName ifTrue:[ |
|
3453 |
fn := aClassName , '.st'. |
|
3454 |
ok := self fileIn:fn lazy:loadLazy silent:beSilent |
|
3455 |
]. |
|
3456 |
ok ifFalse:[ |
|
3457 |
" |
|
3458 |
... and in the standard source-directory |
|
3459 |
" |
|
3460 |
fn := 'source/' , shortName , '.st'. |
|
3461 |
(ok := self fileIn:fn lazy:loadLazy silent:beSilent) |
|
3462 |
ifFalse:[ |
|
3463 |
shortName ~= aClassName ifTrue:[ |
|
3464 |
fn := 'source/' , aClassName , '.st'. |
|
3465 |
ok := self fileIn:fn lazy:loadLazy silent:beSilent |
|
3466 |
] |
|
3467 |
] |
|
3468 |
] |
|
3469 |
]. |
|
3470 |
ok ifFalse:[ |
|
3471 |
" |
|
3472 |
new: if there is a sourceCodeManager, ask it for the classes sourceCode |
|
3473 |
" |
|
3474 |
(mgr := Smalltalk at:#SourceCodeManager) notNil ifTrue:[ |
|
3475 |
inStream := mgr getMostRecentSourceStreamForClassNamed:aClassName. |
|
3476 |
inStream notNil ifTrue:[ |
|
3477 |
fn := nil. |
|
3478 |
ok := self fileInStream:inStream lazy:loadLazy silent:beSilent logged:false addPath:nil. |
|
3479 |
] |
|
3480 |
]. |
|
3481 |
]. |
|
3482 |
]. |
|
3483 |
]. |
|
3484 |
] |
|
3485 |
]. |
|
3486 |
ok ifTrue:[ |
|
3487 |
newClass := self at:(aClassName asSymbol). |
|
3488 |
newClass notNil ifTrue:[ |
|
3489 |
fn notNil ifTrue:[ |
|
3490 |
newClass classFilename isNil ifTrue:[ |
|
3491 |
newClass setClassFilename:fn |
|
3492 |
]. |
|
3493 |
]. |
|
3494 |
||
3495 |
doInit ifTrue:[ |
|
3496 |
newClass initialize |
|
3497 |
] |
|
3498 |
] |
|
3499 |
]. |
|
2159 | 3500 |
] valueNowOrOnUnwindDo:[ |
2379 | 3501 |
Compiler compileLazy:wasLazy. |
3502 |
wasSilent notNil ifTrue:[ |
|
3503 |
self silentLoading:wasSilent |
|
3504 |
] |
|
2159 | 3505 |
]. |
3506 |
||
3507 |
^ newClass |
|
3508 |
||
3509 |
"Modified: 11.11.1996 / 09:56:39 / cg" |
|
3510 |
! |
|
3511 |
||
3512 |
fileInClassLibrary:aClassLibraryName |
|
3513 |
"find an object file containing a binary class library in some standard places |
|
3514 |
and load it. This install all of its contained classes. |
|
3515 |
Return true if ok, false if not." |
|
3516 |
||
3517 |
ObjectFileLoader isNil ifTrue:[^ false]. |
|
3518 |
^ (ObjectFileLoader |
|
3519 |
loadObjectFile:(aClassLibraryName , (ObjectFileLoader sharedLibraryExtension)) |
|
3520 |
) notNil |
|
3521 |
||
3522 |
" |
|
3523 |
Smalltalk fileInClassLibrary:'libtable' |
|
3524 |
Smalltalk fileInClassLibrary:'binary/libwidg3' |
|
3525 |
" |
|
3526 |
||
3527 |
"Modified: 8.1.1997 / 17:58:56 / cg" |
|
3528 |
! ! |
|
3529 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
3530 |
!Smalltalk class methodsFor:'time-versions'! |
453 | 3531 |
|
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3532 |
configuration |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3533 |
"{ Pragma: +optSpace }" |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
3534 |
|
453 | 3535 |
"for developers only: return the configuration, with which |
3536 |
this smalltalk was compiled." |
|
3537 |
||
567 | 3538 |
%{ /* NOCONTEXT */ |
453 | 3539 |
extern char *__getConfigurationString(); |
3540 |
||
3541 |
RETURN (__MKSTRING(__getConfigurationString() COMMA_SND)); |
|
3542 |
%} |
|
3543 |
||
3544 |
" |
|
3545 |
Smalltalk configuration |
|
3546 |
" |
|
3547 |
! |
|
3548 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3549 |
copyrightString |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3550 |
"{ Pragma: +optSpace }" |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
3551 |
|
453 | 3552 |
"return a copyright string" |
3553 |
||
567 | 3554 |
%{ /* NOCONTEXT */ |
829
fc386319f41c
removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents:
822
diff
changeset
|
3555 |
#ifndef __getCopyrightString |
fc386319f41c
removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents:
822
diff
changeset
|
3556 |
extern OBJ __getCopyrightString(); |
568 | 3557 |
#endif |
3558 |
||
829
fc386319f41c
removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents:
822
diff
changeset
|
3559 |
RETURN (__getCopyrightString()); |
567 | 3560 |
%} |
453 | 3561 |
|
3562 |
" |
|
3563 |
Smalltalk copyrightString |
|
3564 |
" |
|
3565 |
! |
|
3566 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3567 |
distributorString |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3568 |
"{ Pragma: +optSpace }" |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
3569 |
|
567 | 3570 |
"return a string describing the distributor of this software" |
3571 |
||
3572 |
%{ /* NOCONTEXT */ |
|
829
fc386319f41c
removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents:
822
diff
changeset
|
3573 |
#ifndef __getDistributorString |
fc386319f41c
removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents:
822
diff
changeset
|
3574 |
extern OBJ __getDistributorString(); |
568 | 3575 |
#endif |
3576 |
||
829
fc386319f41c
removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents:
822
diff
changeset
|
3577 |
RETURN (__getDistributorString()); |
567 | 3578 |
%} |
3579 |
" |
|
3580 |
Smalltalk distributorString |
|
3581 |
" |
|
3582 |
! |
|
3583 |
||
1645 | 3584 |
expirationTime |
3585 |
"{ Pragma: +optSpace }" |
|
3586 |
||
3587 |
"for developers only: return the time when the system will expire. |
|
3588 |
after this time it will not run any longer. |
|
3589 |
It returns nil, if no expiration time has been set (system runs forever :-))" |
|
3590 |
||
3591 |
|exp| |
|
3592 |
||
3593 |
%{ |
|
3594 |
extern unsigned int __getExpirationTime(); |
|
3595 |
||
3596 |
exp = __MKUINT(__getExpirationTime()); |
|
3597 |
%}. |
|
3598 |
exp == 0 ifTrue:[ |
|
2379 | 3599 |
^ nil |
1645 | 3600 |
]. |
3601 |
^ AbsoluteTime new fromOSTime:(exp * 1000). "OSTime is ms since 1970" |
|
3602 |
||
3603 |
" |
|
3604 |
Smalltalk expirationTime |
|
3605 |
" |
|
3606 |
! |
|
3607 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3608 |
hello |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3609 |
"{ Pragma: +optSpace }" |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
3610 |
|
453 | 3611 |
"return a greeting string" |
3612 |
||
3613 |
"stupid: this should come from a resource file ... |
|
3614 |
but I dont use it here, to allow mini-systems without |
|
3615 |
Resource-stuff." |
|
3616 |
||
1307 | 3617 |
|proto lang| |
3618 |
||
3619 |
lang := Language. |
|
3620 |
(lang == #german or:[lang == #de]) ifTrue:[ |
|
2379 | 3621 |
proto := 'Willkommen bei %1 - Version %2 vom %3' |
1307 | 3622 |
]. |
3623 |
(lang == #french or:[lang == #fr]) ifTrue:[ |
|
2379 | 3624 |
proto := 'Bienvenue à %1 - version %2 de %3' |
2 | 3625 |
]. |
1307 | 3626 |
|
3627 |
"/ ... more needed here ... |
|
3628 |
||
3629 |
proto isNil ifTrue:[ |
|
2379 | 3630 |
proto := 'Hello World - here is %1 version %2 of %3'. |
453 | 3631 |
]. |
1307 | 3632 |
|
1412 | 3633 |
^ proto bindWith:(Text string:'SmallTalk/X' emphasis:#bold) |
2379 | 3634 |
with:(self versionString) |
3635 |
with:(self versionDate) |
|
453 | 3636 |
|
3637 |
" |
|
1307 | 3638 |
Smalltalk language:#us. |
3639 |
Smalltalk hello |
|
3640 |
||
3641 |
Smalltalk language:#de. |
|
3642 |
Smalltalk hello |
|
1412 | 3643 |
|
1422 | 3644 |
Transcript showCR:(Smalltalk hello) |
3645 |
Stdout showCR:(Smalltalk hello) |
|
453 | 3646 |
" |
1307 | 3647 |
|
1412 | 3648 |
"Modified: 18.5.1996 / 14:25:13 / cg" |
617 | 3649 |
! |
3650 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3651 |
imageRestartTime |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3652 |
"return a timestamp for the moment when this image was restarted. |
1069 | 3653 |
If we do not execute from an image (i.e. fresh start), return nil." |
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3654 |
|
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3655 |
^ ImageRestartTime |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3656 |
|
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3657 |
" |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3658 |
Smalltalk imageStartTime |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3659 |
Smalltalk imageRestartTime |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3660 |
" |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3661 |
|
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3662 |
"Created: 13.12.1995 / 17:44:20 / cg" |
1069 | 3663 |
"Modified: 6.3.1996 / 11:56:35 / cg" |
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3664 |
! |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3665 |
|
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3666 |
imageSaveTime |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3667 |
"return a timestamp for the moment when this image was saved" |
1100
eebf3ed54b23
reloadAllObjectFiles now called explicit (its too late via ObjMem changed)
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
3668 |
|
eebf3ed54b23
reloadAllObjectFiles now called explicit (its too late via ObjMem changed)
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
3669 |
^ ObjectMemory imageSaveTime |
eebf3ed54b23
reloadAllObjectFiles now called explicit (its too late via ObjMem changed)
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
3670 |
! |
eebf3ed54b23
reloadAllObjectFiles now called explicit (its too late via ObjMem changed)
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
3671 |
|
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3672 |
imageStartTime |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3673 |
"return a timestamp for the moment when this system started the first time |
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3674 |
(i.e. the first initial start without an image)" |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3675 |
|
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3676 |
^ ImageStartTime |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3677 |
|
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3678 |
" |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3679 |
Smalltalk imageStartTime |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3680 |
Smalltalk imageRestartTime |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3681 |
" |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3682 |
|
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3683 |
"Created: 13.12.1995 / 17:44:14 / cg" |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3684 |
"Modified: 13.12.1995 / 17:45:47 / cg" |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3685 |
! |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
3686 |
|
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3687 |
majorVersionNr |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3688 |
"{ Pragma: +optSpace }" |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
3689 |
|
617 | 3690 |
"return the major version number. |
3691 |
This is only incremented for very fundamental changes, |
|
3692 |
which make old object files totally incompatible |
|
3693 |
(for example, if the layout/representation of fundamental |
|
3694 |
classes changes)." |
|
3695 |
||
1941
51332fe23542
bumped version to 3 (I guess, nameSpaces are a major step)
Claus Gittinger <cg@exept.de>
parents:
1917
diff
changeset
|
3696 |
^ 3 |
617 | 3697 |
|
3698 |
" |
|
3699 |
Smalltalk majorVersionNr |
|
3700 |
" |
|
1941
51332fe23542
bumped version to 3 (I guess, nameSpaces are a major step)
Claus Gittinger <cg@exept.de>
parents:
1917
diff
changeset
|
3701 |
|
51332fe23542
bumped version to 3 (I guess, nameSpaces are a major step)
Claus Gittinger <cg@exept.de>
parents:
1917
diff
changeset
|
3702 |
"Modified: 8.11.1996 / 19:59:21 / cg" |
617 | 3703 |
! |
3704 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3705 |
minorVersionNr |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3706 |
"{ Pragma: +optSpace }" |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
3707 |
|
617 | 3708 |
"return the minor version number. |
3709 |
This is incremented for changes which make some old object |
|
3710 |
files incompatible, or the protocol changes such that some |
|
3711 |
classes need rework." |
|
3712 |
||
2967 | 3713 |
^ 2 |
617 | 3714 |
|
3715 |
" |
|
3716 |
Smalltalk minorVersionNr |
|
3717 |
" |
|
1941
51332fe23542
bumped version to 3 (I guess, nameSpaces are a major step)
Claus Gittinger <cg@exept.de>
parents:
1917
diff
changeset
|
3718 |
|
2050
a0e9052cb198
bumped version - nameSpaces seem to be usable
Claus Gittinger <cg@exept.de>
parents:
2033
diff
changeset
|
3719 |
"Modified: 4.1.1997 / 12:22:14 / cg" |
617 | 3720 |
! |
3721 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3722 |
releaseIdentification |
1552 | 3723 |
"{ Pragma: +optSpace }" |
3724 |
||
3725 |
"for developers only: return the release |
|
3726 |
(to further identify the version in case of errors)" |
|
3727 |
||
3728 |
%{ /* NOCONTEXT */ |
|
1553 | 3729 |
extern OBJ __getRel(); |
3730 |
||
3731 |
RETURN (__getRel()); |
|
1552 | 3732 |
%} |
3733 |
||
3734 |
" |
|
3735 |
Smalltalk releaseIdentification |
|
3736 |
" |
|
3737 |
! |
|
3738 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3739 |
releaseNr |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3740 |
"{ Pragma: +optSpace }" |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
3741 |
|
617 | 3742 |
"return the revision number. |
3743 |
Incremented for releases which fix bugs/add features but did not find |
|
3744 |
their way to the outside world." |
|
3745 |
||
2658 | 3746 |
^ 1 |
617 | 3747 |
|
3748 |
" |
|
3749 |
Smalltalk releaseNr |
|
3750 |
" |
|
732
29a49feab799
release bump - that seems to be a good one
Claus Gittinger <cg@exept.de>
parents:
728
diff
changeset
|
3751 |
|
29a49feab799
release bump - that seems to be a good one
Claus Gittinger <cg@exept.de>
parents:
728
diff
changeset
|
3752 |
"Created: 10.12.1995 / 01:42:19 / cg" |
617 | 3753 |
! |
3754 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3755 |
revisionNr |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3756 |
"{ Pragma: +optSpace }" |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
3757 |
|
617 | 3758 |
"return the revision number. |
3759 |
Incremented for releases which fix bugs/add features |
|
3760 |
and represent a stable workable version which got published |
|
3761 |
to the outside world." |
|
3762 |
||
3001 | 3763 |
^ 1 |
617 | 3764 |
|
3765 |
" |
|
3766 |
Smalltalk revisionNr |
|
3767 |
" |
|
1941
51332fe23542
bumped version to 3 (I guess, nameSpaces are a major step)
Claus Gittinger <cg@exept.de>
parents:
1917
diff
changeset
|
3768 |
|
2802
9279d89b2b99
bumbed revision (fixed compiler bug)
Claus Gittinger <cg@exept.de>
parents:
2777
diff
changeset
|
3769 |
"Modified: 30.7.1997 / 12:23:23 / cg" |
617 | 3770 |
! |
3771 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3772 |
timeStamp |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3773 |
"return a string useful for timestamping a file. |
617 | 3774 |
The returned string is padded with spaces for a constant |
3775 |
length (to avoid changing a files size in fileOut with unchanged |
|
3776 |
class)." |
|
3777 |
||
3778 |
^ ('''From Smalltalk/X, Version:' , (Smalltalk versionString) , ' on ' |
|
3779 |
, Date today printString , ' at ' , Time now printString |
|
3780 |
, '''') paddedTo:80 with:(Character space) |
|
3781 |
! |
|
3782 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3783 |
versionDate |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3784 |
"{ Pragma: +optSpace }" |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
3785 |
|
617 | 3786 |
"return the executables build date - thats the date when the smalltalk |
3787 |
executable was built" |
|
3788 |
||
3789 |
%{ /* NOCONTEXT */ |
|
3790 |
extern char *__getBuildDateString(); |
|
3791 |
||
3792 |
RETURN (__MKSTRING(__getBuildDateString() COMMA_SND) ); |
|
3793 |
%} |
|
3794 |
" |
|
3795 |
Smalltalk versionDate |
|
3796 |
" |
|
3797 |
! |
|
3798 |
||
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3799 |
versionString |
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3800 |
"{ Pragma: +optSpace }" |
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
3801 |
|
617 | 3802 |
"return the version string" |
3803 |
||
3804 |
^ (self majorVersionNr printString , |
|
3805 |
'.', |
|
3806 |
self minorVersionNr printString , |
|
3807 |
'.', |
|
3808 |
self revisionNr printString) |
|
3809 |
||
3810 |
" |
|
3811 |
Smalltalk versionString |
|
3812 |
" |
|
2 | 3813 |
! ! |
453 | 3814 |
|
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
3815 |
!Smalltalk class methodsFor:'documentation'! |
630 | 3816 |
|
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
3817 |
version |
3022 | 3818 |
^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.259 1997-10-13 12:58:55 cg Exp $' |
630 | 3819 |
! ! |