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

Bert Freudenberg bert at freudenbergs.de
Tue Nov 21 12:22:28 UTC 2017


>
> 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 -​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20171121/d52ee6b8/attachment.html>


More information about the Squeak-dev mailing list