<br><br><div><span class="gmail_quote">On 9/19/07, <b class="gmail_sendername"><a href="mailto:goran@krampe.se">goran@krampe.se</a></b> &lt;<a href="mailto:goran@krampe.se">goran@krampe.se</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi!</blockquote><div><br>Hello :-).<br>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">&quot;Michael van der Gulik&quot; &lt;<a href="mailto:mikevdg@gmail.com">
mikevdg@gmail.com</a>&gt; wrote:<br>&gt; What do you mean by several packages defining names in the same namespace?<br>&gt; Are you talking about method overrides? Then like I said before, I can&#39;t<br>&gt; work out how to do this without creating a security issue (I&#39;m planning on
<br>&gt; Packages containing completely untrusted code which can be securely execute=<br>&gt; d locally).<br><br>I am not talking about method overrides, no. I am simply talking about<br>package P1 defining a class X in N1 and package P2 defining class Y in
<br>N1. Nothing magical. :)<br></blockquote></div><br><br>My implementation handles this fine. In this case, you&#39;d have P1 containing N1::X (using Krampe notation) and P2 containing N1::Y. The import list of your code using X and Y would include P1 and P2 (import lists contain only other Namespaces, and Packages are Namespaces).
<br><br>When your code contains the name &quot;N1::X&quot;, then the compiler will search P1 (from the import list) for N1, then that N1 for X and find it (and continue searching to make sure the name isn&#39;t ambiguous).  When your code contains the name &quot;N2::X&quot; then the compiler will search P1 (from the import list) for N1, search that N1 for Y, not find it, search P2 (from the import list) for N1, search that N1 for Y, find it and return it (and continue searching to make sure it isn&#39;t ambiguous).
<br><br>Michael.<br>