Autoload.st
changeset 860 b3ffea40999a
parent 789 155eca125ef0
child 886 62c66d49077d
equal deleted inserted replaced
859:a532cd2450dd 860:b3ffea40999a
   214     Smalltalk at:myName put:nil.
   214     Smalltalk at:myName put:nil.
   215 
   215 
   216     "load it"
   216     "load it"
   217     Transcript showCr:('autoloading ', myName , ' ...'); endEntry.
   217     Transcript showCr:('autoloading ', myName , ' ...'); endEntry.
   218 
   218 
   219     Smalltalk fileInClass:myName initialize:false lazy:LazyLoading.
   219     [
       
   220 	Smalltalk fileInClass:myName initialize:false lazy:LazyLoading.
       
   221     ] valueOnUnwindDo:[
       
   222 	Smalltalk at:myName put:mySelf.
       
   223     ].
   220 
   224 
   221     "did it work ?"
   225     "did it work ?"
   222     newClass := Smalltalk at:myName.
   226     newClass := Smalltalk at:myName.
   223     Smalltalk at:myName put:mySelf.   "will be undone by become:"
   227     Smalltalk at:myName put:mySelf.   "will be undone by become:"
   224 
   228 
   251     LoadedClasses add:self.
   255     LoadedClasses add:self.
   252 
   256 
   253     "wow - it worked. now the big trick ..."
   257     "wow - it worked. now the big trick ..."
   254 
   258 
   255     newClass class setSoleInstance:self.   "/ will be undone by become ...
   259     newClass class setSoleInstance:self.   "/ will be undone by become ...
   256     self become:newClass.
   260     self becomeSameAs:newClass.
   257     LoadedClasses rehash.
   261     LoadedClasses rehash.
   258     self initialize.            "/ thats the new class now
   262     self initialize.            "/ thats the new class now
   259     self postAutoload.
   263     self postAutoload.
   260     ^ self  "this is now the new class - see what doesNotUnderstand: does with it"
   264     ^ self  "this is now the new class - see what doesNotUnderstand: does with it"
   261 ! !
   265 ! !
   360 ! !
   364 ! !
   361 
   365 
   362 !Autoload class methodsFor:'documentation'!
   366 !Autoload class methodsFor:'documentation'!
   363 
   367 
   364 version
   368 version
   365     ^ '$Header: /cvs/stx/stx/libbasic/Autoload.st,v 1.37 1995-12-19 19:13:20 cg Exp $'
   369     ^ '$Header: /cvs/stx/stx/libbasic/Autoload.st,v 1.38 1996-01-15 14:04:23 cg Exp $'
   366 ! !
   370 ! !
   367 Autoload initialize!
   371 Autoload initialize!