Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!mcgill-vision!snorkelwacker!usc!wuarchive!cs.utexas.edu!ut-emx!emx.utexas.edu From: sukumar@emx.utexas.edu (Sukumar Rathnam) Newsgroups: comp.lang.smalltalk Subject: LOADER Message-ID: <36912@ut-emx> Date: 5 Sep 90 05:19:30 GMT Sender: sukumar@ut-emx Organization: The University of Texas at Austin; Austin, Texas Lines: 93 Here is the summary of responses I received about the loader. As an interesting side effect I have a hack which will save object instances. I apologize for the delay as our m/c was undergoing a triple coronory by-pass and a major OS upgrade. ------------------------------------------------------------------ From: Michael Felt Since you have the old loader the only change you need to make is a statement using the method becomes: In V becomes: swaps both sides while in /286 it is only a becomes: b (i.e. b does not also become a). Further, I know that digitalk has been working on a new loader that doesn't use becomes: at all (becomes: on /286 is SLOW!) And, by the way, with this patch the loader also works on smalltalk mac. michael From: RICK@and.cs.liv.ac.uk Subject: LOADER I think this may do what you want. Its part of the Gnu Smalltalk system, and is used for on demand loading of class definitions. If you have a class called Fish, in a file Fish.st, you just evaluate the expression: Autoload class: #Fish from: 'Fish.st' Ive only been writing Smalltalk for a short while, and have never used Digitalk, so Im not certain that it will work, but its probably worth a try. Since Autoload is covered by the Gnu general licence, I have to tell you where to get the rest of Gnu Smalltalk from. You can get it from sevevral of the anonymous ftp sites in the US - wuarchive.wustl.edu is one. Its quite a good system, considering its still under development, and free. When version 1.2 is released its probably worth looking at, if you have a machine on which it will run. Let me know if it works or not, or if you need a hand, Rick. Liverpool University Computer Science Department. -------------------------------------------------------------------------------- Object subclass: #Autoload instanceVariableNames: 'className fileName' classVariableNames: '' poolDictionaries: '' category: 'Cool hacks' ! Autoload comment: 'I am not a part of the normal Smalltalk kernel class system. I provide the ability to do late-loading or "on demand loading" of class definitions. Through me, you can define any class to be loaded when any message is sent to the class itself (such as to create an instance).' ! !Autoload class methodsFor: 'instance creation'! class: classNameString from: fileNameString ^Autoload new autoloadInitClass: classNameString initFile: fileNameString !! !Autoload methodsFor: 'accessing'! doesNotUnderstand: aMessage | s | Smalltalk removeKey: className. FileStream fileIn: fileName. ^aMessage reinvokeFor: (Smalltalk at: className ifAbsent: [ ^Autoload error: 'Autoloaded file should have defined class "', className, '" but didn''t' ]) !! !Autoload methodsFor: 'private'! autoloadInitClass: aClassName initFile: aFileName className _ aClassName asSymbol. Smalltalk at: className put: self. fileName _ aFileName. !! Autoload superclass: nil! "force undefined methods"