A little namespace "proposal"

goran.krampe at bluefish.se goran.krampe at bluefish.se
Fri Apr 9 10:25:06 UTC 2004


Hi all!

(Trying to squeeze in a few replies before going out in the sun.)

Richard Staehli <rastaehli at mac.com> wrote:
> Requiring that the source *always* have the qualified names is fine 
> unless you plan to use namespaces a lot.  If namespaces are useful, and 
> I assume we agree that they are, then our code becomes verbose, 
> depending on the length of the namespace qualifier strings.  If the 

Nope it won't. :) Almost all the tools in the image (well, not sure how
the tools that look at non-compiled code will handle it) will remove
that verbosity if you read my proposal.

> names for namespaces are not to conflict they must be allocated by some 
> domain hierarchy like internet host names or via GUIDs (yuck).

I expressly proposed a "flat" list of namespaces. No hierarchies etc. I
propose we just have a namespace registry on SM. This will keep them
short and still unique. The Java idea with using the domains of the
Internet has caused hideously long package names. Yuk.
 
> Another solution to keep the code simple (without imports) is allow 
> (optional) identifier alias declarations in the class definition (you 
> can't compile without the class definition anyway).

I really don't like aliases/renaming. Andreas pointed out the problem
perfectly in his reply.
 
> An alias for a long namespace identifier can be used to make code 
> easier to read.  An alias for a commonly used identifier can be 
> declared to avoid having to fully qualify every occurrence.  The code 

I don't think you have understood the proposal - when I say "fully
qualified in the source" it doesn't mean it will be *displayed* fully
qualified in the browsers and other tools.

You will *not* be forced to fully qualify every occurence when typing in
code, and you will *not* be forced to read the fully qualified names
either. In fact - I am betting that my proposal will almost not be
noticed in a vanilla Squeak image!

regards, Göran



More information about the Squeak-dev mailing list