Autoload.st
changeset 8431 3e06c959dcff
parent 8382 c3fe9de270ad
child 8482 6ca4f0d2594d
equal deleted inserted replaced
8430:8834f0014fb8 8431:3e06c959dcff
   332                     (Smalltalk 
   332                     (Smalltalk 
   333                         fileInClass:myName
   333                         fileInClass:myName
   334                         package:package
   334                         package:package
   335                         initialize:false 
   335                         initialize:false 
   336                         lazy:LazyLoading
   336                         lazy:LazyLoading
   337                         silent:nil) isNil 
   337                         silent:nil)  
   338                     ifTrue:[
   338                     isNil ifTrue:[
   339                         "/ temporary: try without stx/package prefix
   339                         "/ temporary: try without stx/package prefix
   340                         "/ this will vanish as soon as source-directory
   340                         "/ this will vanish as soon as source-directory
   341                         "/ is always guaranteed to contain an stx-subtree
   341                         "/ is always guaranteed to contain an stx-subtree
   342                         ((package startsWith:'stx/') 
   342                         ((package startsWith:'stx/') 
   343                         or:[package startsWith:'stx:']) ifTrue:[
   343                         or:[package startsWith:'stx:']) ifTrue:[
   356         ClassCategoryReader sourceMode:prevMode.
   356         ClassCategoryReader sourceMode:prevMode.
   357         project notNil ifTrue:[
   357         project notNil ifTrue:[
   358             Project setProject:project.
   358             Project setProject:project.
   359         ].
   359         ].
   360     ] ifCurtailed:[
   360     ] ifCurtailed:[
       
   361         "something went wrong, restore previous state"
   361         ClassCategoryReader sourceMode:prevMode.
   362         ClassCategoryReader sourceMode:prevMode.
   362         project notNil ifTrue:[
   363         project notNil ifTrue:[
   363             Project setProject:project.
   364             Project setProject:project.
   364         ].
   365         ].
   365         Smalltalk at:myName put:mySelf.
   366         Smalltalk at:myName put:mySelf.
   368     "did it work ?"
   369     "did it work ?"
   369     newClass := Smalltalk at:myName.
   370     newClass := Smalltalk at:myName.
   370     Smalltalk at:myName put:mySelf.   "will be undone by become:"
   371     Smalltalk at:myName put:mySelf.   "will be undone by become:"
   371 
   372 
   372     "no - report the error"
   373     "no - report the error"
   373     newClass isNil ifTrue:[
   374     (newClass isNil or:[newClass isLoaded not]) ifTrue:[
   374         "
   375         "
   375          this signal is raised, if an autoloaded class
   376          this signal is raised, if an autoloaded class
   376          cannot be loaded. Usually, this happends when
   377          cannot be loaded. Usually, this happends when
   377          some sourcefile is missing, not readable or if 
   378          some sourcefile is missing, not readable or if 
   378          an entry is missing in the abbreviation file.
   379          an entry is missing in the abbreviation file.
   832 ! !
   833 ! !
   833 
   834 
   834 !Autoload class methodsFor:'documentation'!
   835 !Autoload class methodsFor:'documentation'!
   835 
   836 
   836 version
   837 version
   837     ^ '$Header: /cvs/stx/stx/libbasic/Autoload.st,v 1.124 2004-06-07 15:43:23 cg Exp $'
   838     ^ '$Header: /cvs/stx/stx/libbasic/Autoload.st,v 1.125 2004-07-01 10:06:47 stefan Exp $'
   838 ! !
   839 ! !
   839 
   840 
   840 Autoload initialize!
   841 Autoload initialize!