Hi Marcel,
Yes, putting the method(s) in Project class would be better than having than Object>>currentProjectWorld. But we already have Object>>currentWorld that actually refers to ActiveWorld rather than World, so if we add Project class>>currentWorld to represent World, it would probably just add confusion.
That leaves me stuck for a good name, because Project class>>currentWorld would conflict with the meaning of the existing Object>>currentWorld, and Process class>>world would confict with the meaning of the existing Morph>>world.
Probably it is best to do nothing at this point. The Project current world idiom is messy but it least is does mean what it says.
Dave
On Sat, Nov 25, 2017 at 08:59:53AM +0100, Marcel Taeumel wrote:
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@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