[squeak-dev] The Trunk: Morphic-dtl.1370.mcz

David T. Lewis lewis at mail.msen.com
Tue Nov 21 13:43:32 UTC 2017


On Tue, Nov 21, 2017 at 01:22:28PM +0100, Bert Freudenberg wrote:
> >
> > tem was added:
> > + ----- Method: MorphicProject>>clearGlobalState (in category 'enter')
> > -----
> > + clearGlobalState
> > +       "Clean up global state. The global variables World, ActiveWorld,
> > ActiveHand and ActiveEvent
> > +       provide convenient access to the state of the active project in
> > Morphic. Clear their prior values
> > +       when leaving an active project. This method may be removed if the
> > use of global state variables
> > +       is eliminated."
> > +
> > +       (Smalltalk at: #World ifAbsent: []) ifNotNil: [:w | w := nil]. "If
> > global World is defined, clear it now"
> > +       ActiveWorld := ActiveHand := ActiveEvent := nil.
> > + !
> >
> >   ----- Method: MorphicProject>>finalEnterActions: (in category 'enter')
> > -----
> >   finalEnterActions: leavingProject
> >         "Perform the final actions necessary as the receiver project is
> > entered"
> >
> >         | navigator armsLengthCmd navType thingsToUnhibernate |
> > +       "If this image has a global World variable, update it now"
> > +       (Smalltalk at: #World ifAbsent: [])
> > +               ifNotNil: [:w | w := world].  "Signifies Morphic"
> > -       World := world.  "Signifies Morphic"
> >         world install.
> >
> 
> ???I guess assigning to the argument of ifNotNil: is not what you had in mind
> in these two cases?
> 
> - Bert -???

Ouch, how embarassing. What I meant was:

	(Smalltalk at: #World ifAbsent: [])
		ifNotNil: [ Smalltalk at: #World put: nil ]. "If global World is defined, clear it now"

and:

	"If this image has a global World variable, update it now"
	(Smalltalk at: #World ifAbsent: [])
		ifNotNil: [ Smalltalk at: #World put: world ].  "Signifies Morphic"


But I should first ask if SmalltalkImage>>at:put: is a reasonable thing to do here anyway?
If not I will back out those changes entirely. Sorry, I should have asked, or put it
in the inbox first.

For now, I am going to fix the block var assigment (yikes, what was I thinking?!?)
as per the above, and I will revert it completely if the #at:put: is not a good thing
to be doing.

I'll also revert the Morph>>delete issue that Marcel pointed out.

There are also some problems that Chris Cunningham has reported, presumably related
to the recent World variable updates. I'm going to focus on clearing those issues
up before proceeding with any additional changes.

Dave



More information about the Squeak-dev mailing list