[squeak-dev] The Inbox: System-jr.948.mcz

Jakob Reschke jakob.reschke at student.hpi.de
Thu May 18 20:43:30 UTC 2017


2017-05-17 1:23 GMT+02:00 Eliot Miranda <eliot.miranda at gmail.com>:
>
> Surely an Environment is installed in some other environment, much like a
> class being installed in its superclass, and hence being present in its
> superclass's subclasses array.

A fresh Environment is completely isolated. It has no connection to
the original Smalltalk globals environment (except via its own class,
or when you put a class in it manually you may navigate to another
environment via the superclass, but Environment does not know about
that). It only gets connected with other environments when you import
something in either direction.

Accessing the upstream and downstream connected environments of a
given Environment would currently involve poking around the
'observers' and 'policies' instance variables. No useful accessors for
navigation yet, because these connections are designed to propagate
the updates of bindings, not to navigate the system.

> So if an Environment is always in relation to the root environment, and
> environments refer to those that they contain, all installed environments
> can be enumerated from the root, touching a small fraction of the entire
> object graph, unlike allInstancesDo: which visits every object in the heap.

There is no explicit hierarchy, but one could start from Smalltalk
globals (or everything in the Instances class variable) and search the
graph of observers (approximately: importers). However, this might not
find strictly *all* implementors and senders in the object memory,
contrary to what the message names #allImplementorsOf: and friends
suggest, or what might be expected from the search box.

Comments? Better ideas? I would not like to implement this if there
are serious objections to the approach from the beginning.


More information about the Squeak-dev mailing list