[squeak-dev] The Trunk: Morphic-cmm.1408.mcz

David T. Lewis lewis at mail.msen.com
Thu Apr 5 00:30:42 UTC 2018


On Wed, Apr 04, 2018 at 11:18:46AM -0700, Eliot Miranda wrote:
> On Tue, Apr 3, 2018 at 11:44 PM, Marcel Taeumel <marcel.taeumel at hpi.de>
> wrote:
> 
> > It should be "Project current world" then.
> >
> 
> But World == Project current world. Why not just World?  (That's a sincere
> question, not an attempt to disagree)
> 

The background on this is that there are a number of global variables
such as World for which the world would be a better place if they were
not global ;-)

Think about a situation in which we have different kinds of projects
in the image, and where one of those projects is typically active an any
time, but you want to have some flexibility with respect to what you mean
by "active".

So, for example, if you define the global World to refer to the PasteUpMorph
that is filling your display, and maybe another global ActiveWorld that
probably refers to the same thing most of the time, but maybe refers to
something else if you are displaying a "world in world" at the moment,
then everything works pretty well. But then if you switch over to some
other kind of project, let's say MVC for the sake of illustration, then
what do those globals mean now?  And what if you want to be in a project
that is not Morphic or MVC, but something else such as a SqueakShellProject?

Global variables such as World are very convenient, but they are a
barrier to some of the modularization that you might want to have, so
it is overall a good idea not to let different parts of the system (e.g.
MVC, Morphic, Morphic3, etc) be directly dependent on them.

With respect to World, I recently did a slew of changes to get rid of
the direct dependencies on that global variable. The current state is
that if you remove that variable completely from the system dictionary,
the system still works. The variable itself is retained (and updated
at the appropriate times) because it is a well-known name, and because
it is an important convenience from the point of view of people evaluating
expressions in a workspace.

Unfortunately, we have no way of marking globals as "deprecated", but
if we had such a thing, I would say the World is deprecated but retained
for convenience.

Dave



More information about the Squeak-dev mailing list