[squeak-dev] What about "self currentProject"?

Marcel Taeumel marcel.taeumel at hpi.de
Tue Mar 2 09:03:02 UTC 2021


Hi all!

After typing "Project current" for the n-th time, I was wondering, whether "self currentProject" could be a nice little idiom for the Squeak environment. 

We had several thoughts on this matter:
http://forum.world.st/Object-gt-gt-currentProjectWorld-td5044161.html#a5045072 [http://forum.world.st/Object-gt-gt-currentProjectWorld-td5044161.html#a5045072]

http://forum.world.st/Changeset-Eliminating-global-state-from-Morphic-tp5121690p5123334.html [http://forum.world.st/Changeset-Eliminating-global-state-from-Morphic-tp5121690p5123334.html]


1. Object >> #currentProject would be a *System extension in Object to not be dependent on Morphic.
2.  "Project current world" could be replaced with "self currentProject world" (generic) or "self currentWorld" (specific to Morphic).
3. "Project uiManager" could be replaced with "self currentProject uiManager".
4. "Project current addDeferredUIMessage:" could be replaced with "self currentProject addDeferredUIMessage:".

So, we wouldn't have so many class references to "Project" in the code. It kind of reminds me about some of Newspeak's design goals. :-)

What do you think?

Best,
Marcel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20210302/38748900/attachment.html>


More information about the Squeak-dev mailing list