Namespaces

stéphane ducasse ducasse at iam.unibe.ch
Sun Apr 4 08:56:00 UTC 2004


> Hmm, the funny thing about Andreas' approach seems to be that :: is no 
> operator at all. It's simply part of the class name. So class Bar in 
> namespace Foo just has the name #Foo::Bar. Indeed, "::" is a great 
> choice here because colons can already be part of literal symbols.

Bert you are funny how could I guess it? I'm not working with andreas, 
even if it would be good to have more occasion to talk during the year 
in front of a black board.  Still my point is that people
often associate namespace with a scope operator . in VW, :: in C++ and 
namespace and scoping operator are not necessary linked.

> In a sense, it's TSTTCPW. You already can define a class named 
> Foo::Bar today (try it!). A little scanner modification makes Foo::Bar 
> get recognized as one word. This lets you refer to the class directly 
> (today you'd have to write "Smalltalk at: #Foo::Bar").
>
> So without any "namespace support" I can define and use a class named 
> "Foo::Bar".
sure

> All current tools should continue to work. What the namespace support 
> then adds is not much more than allowing you to use the short name 
> "Bar" for "Foo::Bar" if you are inside the "Foo" namespace.

But can you refer to X::Z within Foo (I guess not the way you phrase 
it)?

>
> I must admit I like the simplicity of this approach a lot. And since 
> it is so unintrusive, it should minimize conflict with more 
> sophisticated techniques like classboxes.

Sure. All the discussions I had was just to say that there are 
different approaches.
and that namespaces are not Java packages ;)

Stef




More information about the Squeak-dev mailing list