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

Levente Uzonyi leves at caesar.elte.hu
Sun Mar 25 21:52:47 UTC 2018


On Sun, 25 Mar 2018, Jakob Reschke wrote:

> 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

#at:put: is the legacy method. It doesn't make much sense when the 
receiver is an Environment. It used to make sense when Smalltalk was a 
SystemDictionary.
#bind:to: is too general. There should be #bind:toGlobal:, #bind:toClass: 
and maybe #bind:toAlias: as well.

> 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...).

Agreed. See above.

> 
> 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.

That's fine for the moment. But why have different classes for different 
kinds of bindings when they can't be used?

Levente

P.S.: Most of these issues exist, because Environments, as I mentioned 
it a few times before here, is incomplete.

> 
> Kind regards,
> Jakob
> 
>


More information about the Squeak-dev mailing list