[squeak-dev] Looking for scope in superclass environment

Frank Shearar frank.shearar at gmail.com
Tue Jul 30 20:25:37 UTC 2013


On 30 July 2013 21:15, Nicolas Cellier
<nicolas.cellier.aka.nice at gmail.com> wrote:
> Currently, bindingOf:environment: will search for scope in superclass
> environment.
> This is an easy way to import all Smalltalk globals, since you'll end up
> looking in Object/ProtoObject environment.
>
> But is it the way it should be?
> Couldn't we inherit from a class without importing all the environment in
> which it was declared?
>
> Couldn't we instead explicitily ask to import: #SomeClass or all of
> Smalltalk globals?
> (Beware, someone must ask Smalltalk to export: #SomeClass, or exportSelf for
> such import to be possible)

I would prefer to see explicit imports.

What would happen to class references in the superclass? Would those
resolve in the context of the superclass' environment, or the
subclass'? (I think it would be more useful to resolve said references
in the subclass, but I haven't thought long and hard about the
problem.)

frank

> Nicolas
>
>
>


More information about the Squeak-dev mailing list