A little namespace "proposal"

Doug Way dway at mailcan.com
Wed Apr 7 21:33:07 UTC 2004


goran.krampe at bluefish.se wrote:

>Michael van der Gulik <squeakml at gulik.co.nz> wrote:
>  
>
> ...
>
>>So then you can do:
>>
>>self namespace importNamespace: #AnotherNamespace
>>
>>at runtime, or put them in the importedNamespaces list at.. er.. 
>>compile-time.
>>
>>Instead of saying ANamespace::AClass in code, you could do the (uglier):
>>
>>c := self namespace getClass: #ClassName fromNamespace: #ANamespace.
>>bob := c new.
>>
>>or is that too ugly? 
>>

Yes, it's too ugly. :-)

I recall early on Avi mentioned ANamespace.AClass as a possibility, 
which I might slightly prefer over ANamespace::AClass, just because 
xxx.yyy.zzz has lately become a relatively universal way to form 
compound names, mostly because of internet domain names.  Also, the 
period is very unobtrusive and small.  Although colons are pretty 
unobtrusive too, and :: has no current meaning in Smalltalk, so I'm fine 
with ANamespace::AClass.  I guess it's also simpler to implement with :: 
which is a slight bonus, but shouldn't be the only factor in the decision.

>>It's wordy, but it "feels" right. All the existing 
>>classes could be put into a "Smalltalk" namespace until they've been 
>>sorted into their own namespaces. If a class name is not present in the 
>>importedNamespaces list, then IMO that class shouldn't be accessable.
>>
>>Smalltalk is a nice simple language. Please don't change it's syntax if 
>>you don't need to!
>>    
>>
>
>Eh... and what you proposed was simple? :) :)
>

Simple/clean to implement, I can understand, but kind of horrible to 
use. ;-)  This is another one of those implementation simplicity versus 
usage simplicity situations... there needs to be a balance between the two.

- Doug





More information about the Squeak-dev mailing list