Last updated at 3:36 pm UTC on 14 January 2006
Torge Husfeldt is attempting to build a more robust fileIn. The following documents the motivation and implementation of this idea.
On Tue, Jun 04, 2002 Mike Rutenberg wrote:
> > Why did this [unspecified problem]happen? The original problem seems to be that at some point and in only some images the class ResourceCollector disappeared. The change set 4859resFix-mir – Michael Rueger – 3 May 2002 refers to ResourceCollector and so breaks when you try to add two methods to the non existing class.
Lex Spoon replied:
> Squeak is robust in cases like this for instance variables. If you use a variable at the beginning of a changeset, and then define it later, Squeak will temporarily allocate a global variable in Undeclared. Whenever a variable is defined for real, the methods using it will be recompiled and the undeclared entry will go away.
> Methods and class definitions could also be made robust. For both cases, we could define an empty class which is a subclass of object,and add the method or subclass to that empty class. But, we can't easily do so with the current fileout format, because the classes are referenced directly instead of by name. How about we start a move towards using the ANSI SIF format? That format should easily allow tricks like this.
> Alternatively, don't do file-in's by executing the commands. Just run the parser, and then analyze what it looks like.... Or, most simply of all, change the fileout format to use symbols for class names, like this:
(Smalltalk robustClassNamed: #ResourceBuilder) methodsFor:'blahblah'!
> Now in theory, experienced programmers don't make mistakes like trying to add a method to a class that doesn't exist. But clearly, even experienced programmers bump into this kind of thing every once in a while. Imagine what novices, such as people taking a class based on Squeak, will run into. Simply halting the filein makes it harder to recover.
On 11 June 2002 Archive ID: 6360 Torge Husfeldt announced:
Your wish is my order! Attached is a change set that does exactly this.["Makes fileIns more robust in that it replaces direct class references with calls to Smalltalk. Unfortunately this changes the fileOut format so a little hack is included to make new changeSets still fileInto old images." ]
On 14 June 2002 Archive ID: 6376, Torge updated the announcement
- modified compatibility chunk so that dummy selector robustClassNamed: is removed from Smalltalk class after succesful fileIn (and only the dummy).
- modified compatibility chunk so that SystemDictionary is referred to as 'Smalltalk class' and implementors are found by the #lookupSelecor: mechanism (providing more robustness).
- 1. Removing of dummy selector will still fail if:
- 1.1. fileIn is not successful (but user may expect anomalities in that case)
- 1.2. #at: is redefined in the fileIn (i.e. #at: in Smalltalk class's inheritance chain)
- 2. Compatibility chunks are only written for ChangeSet fileOuts but the fileOut format is changed for (almost) every way of invoking. So a fileOut of a class or a method category or a single method or... will not load in an old-style image.