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

Marcel Taeumel marcel.taeumel at hpi.de
Thu Apr 5 08:59:07 UTC 2018


Well, "ActiveWorld" is a dynamic variable that provides dynamic scope. Just like "ActiveEvent" and "ActiveHand". Useful and powerful in some cases. To be applied with caution. Yet, we have no alternative at the moment. Personally, I think we do not need any.

"World" is a global variable that we do not need anymore since the addition of "Project" and the projects concept some time ago.

Then, each visible morph has its own reference to a world. Usually, code should refer to this world when passing an instance as message argument.

---

Currently, we have 6 senders of "World" left. We should make it 0.
We also have 219 senders of "ActiveWorld" left. We should reduce that number to 10 or so in the core Morphic framework. Most of the other cases do not require ActiveWorld.

---

Dynamically-scoped variables are great for writing robust tests in such a primarily state-based environment. :-)

Best,
Marcel
Am 05.04.2018 10:36:57 schrieb Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>:
Hi Marcel,

yes, but the goal is rather to get rid of a global state (The single active World) and replace with a specific world passed by message or whatever.

In Project current world, we have messages that provide indirection levels instead of a direct access by global scope.

This is maybe more robust to future change (in balance with less simplicity).

But we still have a global state (The active world).

Maybe that's what Eliot was meaning (but I should rather let Eliot speak).


2018-04-05 10:03 GMT+02:00 Marcel Taeumel <marcel.taeumel at hpi.de [mailto:marcel.taeumel at hpi.de]>:

Ah, sorry. In my mind, I separate classes from other globals. I was referring to these other globals. Classes are fine -- even though one should always evaluate the need for any new class in the system, too.

Best,
Marcel
Am 05.04.2018 09:59:29 schrieb Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com [mailto:nicolas.cellier.aka.nice at gmail.com]>:
But we replaced a global World by another global Project.

It's more about limiting the number of globals to a set of more universal roots?


2018-04-05 9:42 GMT+02:00 Marcel Taeumel <marcel.taeumel at hpi.de [mailto:marcel.taeumel at hpi.de]>:

Because with "Project current world" we have messaging (#current, #world) as point of variation. Pure state access via globals is too limited.

Best,
Marcel
Am 04.04.2018 20:18:58 schrieb Eliot Miranda <eliot.miranda at gmail.com [mailto:eliot.miranda at gmail.com]>:


On Tue, Apr 3, 2018 at 11:44 PM, Marcel Taeumel <marcel.taeumel at hpi.de [mailto: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)
 

Best,
Marcel
Am 04.04.2018 06:17:03 schrieb commits at source.squeak.org [mailto:commits at source.squeak.org] <commits at source.squeak.org [mailto:commits at source.squeak.org]>:
Chris Muller uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-cmm.1408.mcz [http://source.squeak.org/trunk/Morphic-cmm.1408.mcz]

==================== Summary ====================

Name: Morphic-cmm.1408
Author: cmm
Time: 3 April 2018, 11:15:51.160237 pm
UUID: 35b2e2ad-c421-4510-a635-774bfd84e597
Ancestors: Morphic-cmm.1407

The responsibility of #anyOpenWindowLikeMe, as indicated by its name, is to look in the actual World world for any open window like the receiver, not the receivers #world (which is nil, because because we wish to look in the real world first!).
Fixes the Reuse Windows preference.

=============== Diff against Morphic-cmm.1407 ===============

Item was changed:
----- Method: SystemWindow>>anyOpenWindowLikeMe (in category 'open/close') -----
anyOpenWindowLikeMe

self class reuseWindows ifFalse: [ ^Array empty ].
^ SystemWindow
+ windowsIn: World
- windowsIn: self world
satisfying:
[ : each |
each model class = self model class
and: [ (each model respondsTo: #representsSameBrowseeAs:)
and: [ each model representsSameBrowseeAs: self model ] ] ]
!









--

_,,,^..^,,,_

best, Eliot







-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20180405/cf90beec/attachment.html>


More information about the Squeak-dev mailing list