Namespace confusion
Paul Matthew Reilly
paul@pajato.com
Fri Aug 13 13:06:00 GMT 1999
Tom Tromey <tromey@cygnus.com> writes:
> Or do you mean that having two namespaces with the same, nested in
> different parent namespaces, doesn't work?
>From what I can tell having two namespaces with the same name, nested
in different parent namespaces doesn't work.
I had problems with the java part of java.lang and
gnu.java.awt.peer.gtk, and the awt part of java.awt and
gnu.java.awt.peer.gtk. Using gnu.javaz.awtz.peer.gtk got me past the
namespace or class unknown error. CLASSPATH came up with
gnu.java.awt.peer.gtk, so I'm stickly with it until I can get the
conversion to cni completed, then I'll think about shortening the
package name to something like Per suggested.
> As far as I know both these cases are allowed.
I'm hoping so, because I'm reasonably certain that it is a common
practice to have duplicate package names with different parent
packages in Java.
> But I stopped learning C++ before namespaces or exceptions were
> implemented anywhere...
I'm learning namespaces for the first time, too. Is there a good
reference on the internet for learning about namespaces?
I'm going to start by looking through the gcc source code. I'll post
whatever I discover.
-Paul
More information about the Java
mailing list