[GOODIE] Namespaces-gk
Avi Bryant
avi at beta4.com
Thu Apr 15 19:34:41 UTC 2004
On Apr 15, 2004, at 12:19 PM, stéphane ducasse wrote:
>
> On 15 avr. 04, at 20:57, Avi Bryant wrote:
>
>> So, looking through the code, one thing that strikes me as overly
>> complicated is all the various modifications around renaming. Why
>> are they necessary? I guess so that you can update the 'environment'
>> instance variable, but then, it's unnecessary too - why can't the
>> namespace of a class be a dynamic lookup?
>>
>> Class>>namespace
>> ^ Namespace namedOrCreateForName: self name
>>
> Hi avi
>
> why not using environment? This is why we started to removed all the
> hardcoded reference to smalltalk from the kernel and as soon as
> 3.8alpha starts I'm planning to do a major cure of the image.
Precisely because everything that used to reference Smalltalk now sends
#environment, I think we should be careful about using it. For now,
the #environment of any code *is* Smalltalk; returning anything else is
effectively lying and is bound to get you into trouble. I think Göran
was mostly using it because it's a spare instance variable on Class,
not because Namespace provides all the semantics an #environment should
(no doubt he'll correct me if I'm wrong).
Eventually, we may well find a use for that extra indirection, but I
don't think this is it.
More information about the Squeak-dev
mailing list
|