Unloading packages with Environments (was Re: [squeak-dev] Re: Towards SqueakCore)

Colin Putney colin at wiresong.com
Tue Apr 2 16:40:27 UTC 2013


On Tue, Apr 2, 2013 at 6:45 AM, Frank Shearar <frank.shearar at gmail.com>wrote:


>
> uSo it _looks_ like Environments has a slight case of split brain: the
> contents and bindings instvars seem to do the same job (inspecting
> "Environment default" and looking at the contents of contents and
> bindings), and it looks like we're moving things over to bindings
> (#assocationAt: pulls stuff out of contents, while
> #associationOrUndeclaredAt: is more recent, and pulls stuff out of
> bindings. #migrate copies contents' contents into bindings).
>
> Does that sound like a fair assessment? If so, I suspect that we
> simply haven't pushed the migration far enough yet.
>

Sort of.

The 'contents' dictionary is for classes and globals that are declared
within the environment. The 'bindings' dictionary is for bindings that are
referenced from methods compiled within the environment. So when you create
a class, it goes into 'contents', and when you refer to the class in a
method, that binding gets copied (or aliased) into 'bindings', possibly of
another environment.

Colin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20130402/f94bc0aa/attachment.htm


More information about the Squeak-dev mailing list