[squeak-dev] Object>>currentProjectWorld

Marcel Taeumel marcel.taeumel at hpi.de
Sat Nov 25 07:59:53 UTC 2017


Hi Dave,

the term "current" in "currentProjectWorld" seems not appropriate for "Project current world" because it is not dynamically scoped like #currentWorld. Also it is not Morphic-API. Would thus be confusing in the long term.

Assuming that currentEvent, currentHand, and currentWorld are in a *Morphic extension, what about adding "Project class >> #currentWorld" instad? Let's not spoil the Object interface more than necessary. :-)

Best,
Marcel
Am 25.11.2017 03:36:13 schrieb David T. Lewis <lewis at mail.msen.com>:
In Object method category *Morphic-Kernel, we currently have three methods:

Object>>currentEvent
"Answer the current Morphic event. This method never returns nil."

Object>>currentHand
"Return a usable HandMorph -- the one associated with the object's current environment."

Object>>currentWorld
"Answer a morphic world that is the current UI focus."

I want to suggest adding one more method:

Object>>currentProjectWorld
"Answer a morphic world for the current project."
^Project current world

Rationale: In the course of removing direct references to the global variable
World, there are now numerous repetitions of the "Project current world" idiom.
If these are replaced by "self currentProjectWorld", the code is a bit more
readable, and the references to Project current world are easier to find. This
should also make the distinction between #currentWorld and #currentProjectWorld
easier to understand.

Is it OK if I add this method, and replace the current "Project current world"
usage with "self currentProjectWorld" throughout?

Dave


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


More information about the Squeak-dev mailing list