[Fix]^2 More Robust fileIn (was: Re: [updates] 18 for 3.3alpha)

Torge Husfeldt jean-jacques.gelee at gmx.de
Thu Jun 13 16:47:07 UTC 2002


Sorry to reply to my own message but there was a subtle bug in the
robustFileInCode (regarding meta classes). Here is the (hopefully)
correct version.


Torge Husfeldt wrote:
> 
> Lex Spoon wrote:
> >
> > On Tue, Jun 04, 2002 at 04:20:05PM +0100, Mike Rutenberg wrote:
> > > Why did this 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.
> >
> > 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,
> > then 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'!
> >
> > No, I'm not volunteering to do it myself, just wishing....  :)
> >
> > 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.
> >
> > _-Lex
> Your wish is my order !
> Attached is a change set that does exactly this.
> I hope for some feedback on these subjects:
> #1 how to supply sUnit test for this cs in order to
> #1.1 make it go in the update stream
> #2 wheater to add the compatibility chunk in more hooks
> #3 if this is ever going to work with modules?
> 
> HTH
> Torge
> >From Preamble:
> "Change Set:            RobustFileIn-th
> Date:                   11 June 2002
> Author:                 Torge Husfeldt
> 
> 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."
> 
>   ------------------------------------------------------------------------
>                            Name: RobustFileIn-th.9.cs
>    RobustFileIn-th.9.cs    Type: Squeak source code (application/x-squeak-source)
>                        Encoding: base64
-------------- next part --------------
A non-text attachment was scrubbed...
Name: RobustFileIn-th.11.cs
Type: application/x-squeak-source
Size: 4821 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20020613/8de5a38b/RobustFileIn-th.11.sts


More information about the Squeak-dev mailing list