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

Andreas Raab andreas.raab at gmx.de
Sat Apr 3 20:59:10 UTC 2004


> Sure, fine, but my "point" still stands - it would be nice if the
> environment works in an "optimistic" fashion. Meaning that I can
> access for example classes simply by their name *if there are no
> conflicts doing that*. You know what I mean.

I know what you mean but it's really unrelated to the workings of
namespaces. It's a tools question. Say, I type the name "Bar" and it's not
in my namespace - what should happen? In my understanding I would get an
Undeclared exception and the tools I use (e.g., the browser) would check if
it knows anything about it. Since all of the names are fully qualified
present in Smalltalk (aha!) it would be able to find out if there is only a
single one or more. In any case it could ask me whether I mean "Foo::Bar" or
"Baz::Bar" and offer me the choice to simply import it. Or, if it sees that
there is only a single name that matches it might just silently import that.

So my point here is that namespaces are something that's dog-simple. That's
what I meant with "no semantics" - they really shouldn't try to outsmart the
environment by doing mythical things like a reverse-cyclic lookup ;-) That's
part of what tools provide in order to allow you to work as conveniently as
possible but it's not part of the semantics of namespaces.

> Well, sure - my point was that I don't want us to move towards a
> namespace world where you always need to explicitly "import" stuff in
> order to "see" them. It hurts. IMHO.

Not in the general case, no. But in some situations I would actually like
the ability to prevent "implicit imports" even by tools like the above. For
example, if I have a framework which makes use of some internal
collaborators which really aren't part of the public api - in this situation
I would find it helpful if I could prevent someone from "accidentally
importing" the name.

Cheers,
  - Andreas




More information about the Squeak-dev mailing list