[squeak-dev] The Trunk: Environments-dtl.72.mcz

Jakob Reschke forums.jakob at resfarm.de
Sun Mar 25 14:50:19 UTC 2018


Levente Uzonyi <leves at caesar.elte.hu> schrieb am Mi., 21. März 2018, 00:04:

> On Tue, 20 Mar 2018, Jakob Reschke wrote:
>
> > Note that the following also results in ClassBinding:
> > Smalltalk globals at: #Foo put: ProtoObject.
> > (Smalltalk globals associationAt: #Foo) class
> >
> > ...so distinguishing globals that are classes from proper classes is
> > not that easy.
>
> Well, that's because #at:put: is the legacy API that should have been
> removed by now. But we're still very far from that, because there are so
> many questions to answer.
>

#at:put: currently just delegates to #bind:to:, which is not legacy API.
The method where ClassBinding enters the picture is Symbol>>#=>. Maybe the
decision whether to create a class binding or a global variable binding
would have to be determined at another place (not by the environment), such
as ClassBuilder>>#name:inEnvironment:subclassOf:type:instanceVariableNames:classVariableNames:poolDictionaries:category:unsafe:
(not only the selector is huge in this one...).

But then again, checking whether a binding is the "home" binding of a class
can also be done via binding key == class name and: [bindingsEnvironment ==
class environment], as written before. This does not rely on the type of
the binding object, which I find more appealing.

Kind regards,
Jakob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20180325/ad96b75e/attachment.html>


More information about the Squeak-dev mailing list