[squeak-dev] Environment changes in the Inbox

Bert Freudenberg bert at freudenbergs.de
Thu Mar 2 23:06:28 UTC 2017


Let me see if I understand ...

On Thu, Mar 2, 2017 at 3:45 AM, Jakob Reschke <jakob.reschke at student.hpi.de>
wrote:

>
> 1. prepare the environment in a workspace, because there are no tools for
> it:
>
>    env := Environment named: #NewProjectWithPharoBindings.
>

This creates a new empty environment.


>    env import: Smalltalk globals.
>

This makes all current classes available inside the new environment.


>    env from: Smalltalk globals import: { #FSFilesystem -> #FileSystem.
> #FSPath -> #Path. "..." }
>

This makes the FS classes (which you loaded previously) available under the
non-prefixed name, too.


>    env importSelf;


Makes future declarations in this environment visible to itself.


> exportSelf.


Makes future changes in this environment visible to other environments that
imported it.


> 2. open a Workspace that "lives" in the new environment:
>
>   env beCurrentDuring: [Workspace open]
>
>   ...and change its title to remember its purpose.
>

Yoshiki and I tried that but evaluating code still appears to use the
Smalltalk environment. We had to change the evaluateSelectionAndDo: method
in the Morphic package to use the model's environment. Is that a change you
missed?

In general it appears to be working well, although the tool support is
minimal for now. It would be useful if environment-aware tools indicated
the current environment (if it is not the default).

The general metaphor seems to be that an environment just replaces the
global Smalltalk dictionary with its own, but the code in general doesn't
even have to be aware of the existence of other environments. This is in
contrast to how other systems handle modules and namespaces. Would you
think this is a fair characterization?

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


More information about the Squeak-dev mailing list