[squeak-dev] Namespaces

Michael van der Gulik mikevdg at gmail.com
Sat Jul 5 10:45:17 UTC 2008


On Sat, 05 Jul 2008 10:03:38 +0200
Trygve Reenskaug <trygver at ifi.uio.no> wrote:

> Namespaces is sorely needed in Squeak and I applaud  your initiative. 

These Namespaces are not for Squeak. They are for a fork of Squeak I'm making, called SecureSqueak.

Whether this Namespaces architecture eventually becomes integrated into Squeak depends on whether other people in the community consider this to be a good idea and are willing to put work into it.

> A UML Namespace is " a set of named elements that can be identified by 
> name". In Squeak, a Namespace could be a Dictionary of ProtoObjects 
> without any restriction. Local variables, instance variables,  class 
> variables,  pool variables,  ... could be defined as Namesapces and  
> treated correctly by compiler, debugger, etc. According to UML, the 
> Squeak message dictionary is also a Namespace.
> 
> A UML Package is "used to group elements, and provides a namespace for 
> the grouped elements". The grouped elements are "PackageableElements", 
> they include Packages, classes, interfaces, collaborations, constraints, 
> components, ... It seems a good idea to let a Squeak package assume as 
> little as possible about its contents.

That vaguely summarises what I've done.

"Namespace" is a subclass of "Dictionary", and it contains mappings of #Names (i.e. Symbols) to objects. Those objects are typically classes and sub-namespaces, but could be any object. My converter, which converts standard Squeak classes to their Namespaced equivalents, converts shared pools into Namespaces.

"Package" is a subclass of "Namespace", so that it can contain namespaces, classes and other named objects. 

Gulik.


-- 
Michael van der Gulik <mikevdg at gmail.com>



More information about the Squeak-dev mailing list