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

Frank Shearar frank.shearar at gmail.com
Tue Apr 2 16:52:12 UTC 2013


On 2 April 2013 17:40, Colin Putney <colin at wiresong.com> wrote:
>
>
>
> 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.

Ah, OK - contents is for local stuff, and bindings is for stuff pulled
in from elsewhere?

frank

> Colin
>
>
>


More information about the Squeak-dev mailing list