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

Andreas Raab andreas.raab at gmx.de
Fri Apr 2 17:17:50 UTC 2004


> Ok I was not expressing myself well. My point is that we can have
> namespace without having explicit reference operator.
> But this implies that you have to have import statement
> at the namespace level.

Stef, you really need to understand that this is all about the goals you
have. "You do not need a reference operator" is not an argument here simply
because fundamentally you don't need a namespace or imports either - since a
class has an identity (which you could for example express via a UUID) it is
completely irrelevant for the system what its name is. Names are assigned by
humans. And if we want to provide a way to keep that user's namespace clean,
then we may very well need the ability to use an explicit scope.

In this context, "need" is defined by what we want to show to the user - if
we deliberately want to hide some names while keeping them accessible
somehow then we do in fact need a way of referring to a name from some place
which is not in the "first order namespace".

And similarly, if you are happy with putting everything someone uses into a
single flat namespace, then yes, you don't need a reference operator. But
this is a question of what you're trying to achieve, and while I can agree
that for the goals of ClassBoxes you may not need a scope operator that's
not true for my goals. I "need" it ;-)

BTW, you *do* need the ability to rename and this may easily get even more
ugly than having an explicit scope operator. Some names are heavily overused
and it's not clear whether explicitly renaming objects based on what each
single user thinks the convention is would be better than providing a
system-wide consistent way of referring to it.

My preference is with the latter - if I try to import Foo from A and B I
would find it preferrable if I'd have to be explicit and if in code that I
read I see it stated that this is "A::Foo" vs. "B::Foo" instead of renaming
Foo into "Bar" and "Mumble".

Cheers,
  - Andreas




More information about the Squeak-dev mailing list