'From Squeak3.11alpha of 13 February 2010 [latest update: #9483] on 9 March 2010 at 11:11:22 am'! !SmalltalkImage commentStamp: 'dtl 3/6/2010 14:00' prior: 0! I represent the current image and runtime environment, including system organization, the virtual machine, object memory, plugins and source files. My instance variable #globals is a reference to the system dictionary of global variables and class names. My singleton instance is called Smalltalk.! SmalltalkImage class instanceVariableNames: 'current '! IdentityDictionary subclass: #SystemDictionary instanceVariableNames: 'cachedClassNames ' classVariableNames: 'LastImageName LastQuitLogPosition LowSpaceProcess LowSpaceSemaphore MemoryHogs ShutDownList SpecialSelectors StartUpList StartupStamp SystemChanges WordSize ' poolDictionaries: '' category: 'System-Support'! !SystemDictionary commentStamp: 'nice 3/6/2010 21:56' prior: 0! I represent a special dictionary used as global namespace for class names : Smalltalk globals classNames. and for traits too: Smalltalk globals traitNames. and a few other globals: (Smalltalk globals keys reject: [:k | (Smalltalk globals at: k) isBehavior]) collect: [:k | k -> (Smalltalk globals at: k) class]. As the above example let you guess, the global namespace of Smalltalk system is accessed through: Smalltalk globals.! !AbstractLauncher class methodsFor: 'private' stamp: 'ar 3/5/2010 21:50'! extractParameters | pName value index globals | globals := Dictionary new. index := 3. [pName := Smalltalk getSystemAttribute: index. pName isEmptyOrNil] whileFalse:[ index := index + 1. value := Smalltalk getSystemAttribute: index. value ifNil: [value := '']. globals at: pName asUppercase put: value. index := index + 1]. ^globals! ! !SmalltalkImage methodsFor: 'shrinking' stamp: 'ar 3/6/2010 11:26'! unloadAllKnownPackages "Unload all packages we know how to unload and reload" "Prepare unloading" Smalltalk zapMVCprojects. Flaps disableGlobalFlaps: false. StandardScriptingSystem removeUnreferencedPlayers. Project removeAllButCurrent. #('Morphic-UserObjects' 'EToy-UserObjects' 'Morphic-Imported' ) do: [:each | SystemOrganization removeSystemCategory: each]. Smalltalk at: #ServiceRegistry ifPresent:[:aClass| SystemChangeNotifier uniqueInstance noMoreNotificationsFor: aClass. ]. World removeAllMorphs. "Go unloading" #( 'ReleaseBuilder' 'ScriptLoader' '311Deprecated' '39Deprecated' 'Universes' 'SMLoader' 'SMBase' 'Installer-Core' 'VersionNumberTests' 'VersionNumber' 'Services-Base' 'PreferenceBrowser' 'Nebraska' 'ToolBuilder-MVC' 'ST80' 'CollectionsTests' 'GraphicsTests' 'KernelTests' 'MorphicTests' 'MultilingualTests' 'NetworkTests' 'ToolsTests' 'TraitsTests' 'SystemChangeNotification-Tests' 'FlexibleVocabularies' 'EToys' 'Protocols' 'XML-Parser' 'Tests' 'SUnitGUI' ) do:[:pkgName| (MCPackage named: pkgName) unload]. "Traits use custom unload" Smalltalk at: #Trait ifPresent:[:aClass| aClass unloadTraits]. "Post-unload cleanup" PackageOrganizer instVarNamed: 'default' put: nil. SystemOrganization removeSystemCategory: 'UserObjects'. Presenter defaultPresenterClass: nil. World dumpPresenter. ScheduledControllers := nil. Preferences removePreference: #allowEtoyUserCustomEvents. SystemOrganization removeEmptyCategories. ChangeSet removeChangeSetsNamedSuchThat:[:cs | (cs == ChangeSet current) not]. Undeclared removeUnreferencedKeys. StandardScriptingSystem initialize. MCFileBasedRepository flushAllCaches. MCDefinition clearInstances. Behavior flushObsoleteSubclasses. ChangeSet current clear. ChangeSet current name: 'Unnamed1'. Smalltalk flushClassNameCache. Smalltalk at: #Browser ifPresent:[:br| br initialize]. DebuggerMethodMap voidMapCache. DataStream initialize. Smalltalk forgetDoIts. AppRegistry removeObsolete. FileServices removeObsolete. Preferences removeObsolete. TheWorldMenu removeObsolete. Smalltalk garbageCollect. Symbol compactSymbolTable. TheWorldMainDockingBar updateInstances. MorphicProject defaultFill: (Color gray: 0.9). World color: (Color gray: 0.9). ! ! !SmalltalkImage methodsFor: 'system attribute' stamp: 'nice 3/6/2010 20:57'! buildDate "Return a String reflecting the build date of the VM" "Smalltalk buildDate" ^self getSystemAttribute: 1006! ! !SmalltalkImage class methodsFor: 'class initialization' stamp: 'ar 3/5/2010 21:52'! initialize "SmalltalkImage initialize" self initializeStartUpList. self initializeShutDownList. ! ! !SmalltalkImage class methodsFor: 'instance creation' stamp: 'ar 3/5/2010 21:52'! current "Deprecated. Use Smalltalk instead." ^Smalltalk! ! !SmalltalkImage class methodsFor: 'instance creation' stamp: 'ar 3/5/2010 21:52'! new self error: 'Use Smalltalk'.! ! IdentityDictionary subclass: #SystemDictionary instanceVariableNames: 'cachedClassNames' classVariableNames: '' poolDictionaries: '' category: 'System-Support'! SmalltalkImage initialize! SmalltalkImage class instanceVariableNames: ''! SmalltalkImage removeSelector: #extractParameters!