Name spaces in Spoon
Colin Putney
cputney at wiresong.ca
Sat May 27 03:55:22 UTC 2006
On May 26, 2006, at 8:26 PM, Andreas Raab wrote:
> Dan Ingalls wrote:
>> Yes, 'twas I. Here's what I liked and still do like about it: it
>> is a message-based
>> interface to independent modules. I learned a lot from dealing
>> with the direct
>> links in the superclass chain and global variables, when trying to
>> get the full
>> advantage out of imageSegment-based modules.
>
> You get very similar advantages when you consider all references to
> "outside" globals be really definitions inside the module's
> namespace itself. In other words, if module Foo would use "Array
> new" it would really mean "Foo::Array" (e.g., the value of #Array
> inside the module Foo) and you could populate (parametrize) that
> via, say "Foo::Array := Collections::Array" etc. This has the added
> advantage that there is no true "global" access to anything (e.g.,
> no ambient authority beyound what was explicitly given to the
> module) and that multiple modules can co-exist with different
> parametrizations.
Yes! An excellent approach.
I think we rely on globals way, way too much. It makes some things
simpler, but it comes with a high price.
Colin
More information about the Squeak-dev
mailing list
|