[squeak-dev] The Inbox: System-kfr.1036.mcz

karl ramberg karlramberg at gmail.com
Sat Jun 23 19:00:24 UTC 2018


FlasherMorph to Flasher is a known rename. But if you use Flasher in a new
project in trunk 5.2 it would create a false positive rename on loading.
This is a hopefully a fix for that issue.

Best,
Karl
On Sat, 23 Jun 2018 at 19:58, H. Hirzel <hannes.hirzel at gmail.com> wrote:

> I did a re-test with loading
>
> https://freudenbergs.de/bert/squeakjs/Etoys/Home.007.pr
>
> No problem with loading and FlasherMorph.
> http://wiki.squeak.org/squeak/1169
>
> The car moves around.
>
> A unrelated problem as it seems with a script though.
>
> --Hannes
>
> On 6/23/18, David T. Lewis <lewis at mail.msen.com> wrote:
> > On Sat, Jun 23, 2018 at 04:02:29PM +0200, H. Hirzel wrote:
> >> Adding the two lines
> >>
> >> "make sure we don't try to convert classes not in structures to renamed
> >> classes"
> >> renamed keysDo:[ :renamedClass | structures at: renamedClass
> >> ifAbsent:[ renamed removeKey: renamedClass]].
> >>
> >>
> >> to
> >>
> >> SmartRefStream>>reshapedClassesIn:
> >>
> >>
> >> makes a number of *.pr  (SqueakLand project files) load into Squeak
> >> 5.2a which previously did not load.  See screen shot. This does not
> >> necessarily mean that they work, but they load without an error
> >> message.
> >
> > Thanks for the explanation, and the screen shot illustrates nicely :-)
> >
> >
> >>
> >> The instance variable 'renamed' of SmartRefStream contains a
> >> dictionary of Classes who have a different name.
> >>
> >> When loading a project an instance of the new class is made and a
> >> conversion call is sent to that instance.
> >>
> >> (old class name symbol -> new class name).
> >>
> >>
> >> The instance variable 'structures' contains the structure of classes
> >> (class version and order and names of instance variables written then
> >> the *.pr file was saved
> >>
> >> Example:
> >>
> >> structures
> >>
> >> Dictionary of (#Rectangle -> #(<classVersionInteger> 'origin'
> 'corner')).
> >>
> >> Inst var names are strings.
> >>
> >>
> >>
> ----------------------------------------------------------------------------------
> >> Recommendation: This fix should be moved to the trunk
> >>
> ----------------------------------------------------------------------------------
> >>
> >
> > +1
> >
> > Any objections?
> >
> > This would be good to move to trunk. I don't think it causes any issues
> > for the upcoming release, and it is a good improvement (since after all,
> > you cannot debug Etoys projects if you cannot even load them in the first
> > place.
> >
> > I do have one question. Is this a workaround for a bug elsewhere in
> > SmarRefStream?
> > It seems like #reshapedClassesIn: is expecting that anything in the
> renamed
> > dictionary should already be in the structures dictionary. If that is not
> > the case, is that because of a bug, or is it simply the case the the
> > situation
> > occurs normally when dealing with a class that does not exist in the
> system
> > at all?
> >
> > I tried loading EtoysProjects/Home.007.pr to check this in a debugger,
> and
> > I can see that the condition occurs when trying to load FlasherMorph,
> which
> > is not in my image. That suggests this is a "normal" condition, and the
> > end result after loading this project would be unresolved references to
> > that missing class.
> >
> > Sorry for the long question, I'm just trying to understand how this
> works.
> >
> > Either way, +1 for moving to trunk.
> >
> > Dave
> >
> >>
> >>
> >>
> >> On Thu, 21 Jun 2018 18:49:47 0000, commits at source.squeak.org
> >> <commits at source.squeak.org> wrote:
> >> > A new version of System was added to project The Inbox:
> >> > http://source.squeak.org/inbox/System-kfr.1036.mcz
> >> >
> >> > ==================== Summary ====================
> >> >
> >> > Name: System-kfr.1036
> >> > Author: kfr
> >> > Time: 21 June 2018, 8:49:18.217801 pm
> >> > UUID: 4150334e-4f5f-744c-b5b7-814cef973cc0
> >> > Ancestors: System-kfr.1035
> >> >
> >> > Remove classes from SmartRefStream instanceVariable renamed that not
> are
> >> > in
> >> > structures so we avoid false positives
> >> >
> >> > =============== Diff against System-kfr.1035 ===============
> >> >
> >> > Item was changed:
> >> >   ----- Method: SmartRefStream>>reshapedClassesIn: (in category
> 'import
> >> > image segment') -----
> >> >   reshapedClassesIn: outPointers
> >> >    "Look for classes in the outPointer array that have changed shape.
> >> > Make
> >> > a fake class for the old shape.  Return a dictionary mapping Fake
> >> > classes to
> >> > Real classes.  Substitute fake classes for real ones in outPointers."
> >> >
> >> >    | mapFakeClassesToReal |
> >> >
> >> >    self flag: #bobconv.
> >> > +  "make sure we don't try to convert classes not in structures to
> >> > renamed
> >> > classes"
> >> > +  renamed keysDo:[ :renamedClass | structures at: renamedClass
> >> > ifAbsent:[
> >> > renamed removeKey: renamedClass]].
> >> >
> >> > -
> >> >    mapFakeClassesToReal := IdentityDictionary new.
> >> >    outPointers withIndexDo: [:outp :ind | | originalName fakeCls |
> >> >            outp isBehavior ifTrue: [
> >> >                    originalName := renamed keyAtValue: outp name
> >> >                            ifAbsent: [renamedConv at: ind ifAbsent:
> [outp name]].
> >> > +                  "in DiskProxy>>comeFullyUpOnReload: we saved the
> name at the index"
> >> > -                  structures at: originalName ifAbsent:
> [originalName := outp name].
> >> > "check for false positives in renamed"
> >> > -                          "in DiskProxy>>comeFullyUpOnReload: we
> saved the name at the
> >> > index"
> >> >                    fakeCls := self mapClass: outp origName:
> originalName.
> >> >                    fakeCls == outp ifFalse: [
> >> >                            mapFakeClassesToReal at: fakeCls put: outp.
> >> >                            outPointers at: ind put: fakeCls]]].
> >> >    ^ mapFakeClassesToReal!
> >> >
> >> >
> >> >
> >
> >
> >>
> >
> >
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20180623/76bdd308/attachment.html>


More information about the Squeak-dev mailing list