Namespaces (was: Re: [ANN]A plan for 3.8/4.0... (insert drumroll here))

goran.krampe at bluefish.se goran.krampe at bluefish.se
Fri Apr 2 08:46:03 UTC 2004


Hi Andreas, Avi and all!

"Andreas Raab" <andreas.raab at gmx.de> wrote:
> Hi Avi,
> 
> > Thoughts?
> 
> Lots of them.

I have one thought that I just want to reiterate. :) When you guys are
working on this, please keep in mind that one of the beautiful strengths
of Smalltalk is actually the LACK of namespaces.

The freedom that comes with having a snippet of code meaning essentially
the same thing (disregarding temp/instvar shadowing etc) wherever it is
run - is a good thing. I almost barfed when I discovered the "scrapbook"
in VisualAge for Java (=workspace) and that I had to tell it which class
to "run in" before I could try any code doits. Sigh.

When Daniel Vainsencher visited me here in Stockholm he made me realize
that namespaces can be done differently than how it is done in most
other langs today. Almost all other langs seems to be using a
"pessimistic" approach. It would be really cool if Squeak could use an
"optimistic" approach instead.

If all my classes in the image (in all packages) have different names -
then I can refer to them just like today. When I load a package with
"yet another Parser class" then it would be nice to get a conflict and
then resolve it through an explicit reference or some explicit
"remapping" or whatever - but not until there actually is a conflict.

This is good because conflicts are GOOD. It tells us something - "Hey,
perhaps these classes should be merged?" etc. In the Java world where
everyone has their own little sandbox, sure they have no conflicts, but
everyone keeps reinventing the wheels...

It is also good because doing the equivalent of "import
se.bluefish.squeakmap.yaddayadda.*" would drive me totally crazy. I
don't want to go there. Please tell me you don't want that either. :)

regards, Göran



More information about the Squeak-dev mailing list